Skip to content

Commit 41dbb0d

Browse files
committed
Experiment with dist
1 parent 27764c7 commit 41dbb0d

File tree

2 files changed

+130
-65
lines changed

2 files changed

+130
-65
lines changed

.github/workflows/lambda-runner-binaries-syncer.yml

Lines changed: 7 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ env:
33
lambda_name: runner-binaries-syncer
44
lambda_path: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer
55
on:
6-
[push]
7-
# branches:
8-
# - master
9-
# tags:
10-
# - *
11-
# pull_request:
12-
# paths:
13-
# - .github/workflows/lambda-runner-binaries-syncer.yml
14-
# - "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/**"
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
paths:
11+
- .github/workflows/lambda-runner-binaries-syncer.yml
12+
- "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/**"
1513

1614
jobs:
1715
build:
@@ -28,59 +26,3 @@ jobs:
2826
run: yarn lint
2927
- name: Build distribution
3028
run: yarn build
31-
- name: Upload distribution
32-
if: startsWith(github.ref, 'refs/tags/')
33-
uses: actions/upload-artifact@v1
34-
with:
35-
name: dist
36-
path: ${{ env.lambda_path }}/dist
37-
38-
release_draft:
39-
name: Create Draft Release
40-
needs: build
41-
runs-on: ubuntu-latest
42-
container: node:12
43-
if: startsWith(github.ref, 'refs/tags/')
44-
45-
steps:
46-
- name: Create Release
47-
uses: actions/create-release@latest
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
50-
with:
51-
tag_name: ${{ github.ref }}
52-
release_name: Release ${{ github.ref }}
53-
draft: true
54-
prerelease: true
55-
- uses: actions/checkout@v2
56-
- name: Extract tag name
57-
id: tag_name
58-
run: echo ::set-output name=TAG::${GITHUB_REF##*/}
59-
- uses: actions/download-artifact@v2
60-
with:
61-
name: dist
62-
path: dist
63-
- name: Create zip
64-
run: |
65-
apt update && apt install zip
66-
cd dist && zip -r ../${lambda_name}.zip .
67-
- name: Create Release
68-
id: create_release
69-
uses: actions/create-release@latest
70-
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
72-
with:
73-
tag_name: ${{ github.ref }}
74-
release_name: Release ${{ github.ref }}
75-
draft: true
76-
prerelease: true
77-
- name: Upload Release Asset
78-
id: upload-release-asset
79-
uses: actions/upload-release-asset@v1
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
with:
83-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
84-
asset_path: ${{ env.lambda_name }}.zip
85-
asset_name: ${{ env.lambda_name }}-${{ steps.tag_name.outputs.TAG }}.zip
86-
asset_content_type: application/zip

.github/workflows/release.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Release build
2+
3+
on:
4+
[push]
5+
# branches:
6+
# - master
7+
# tags:
8+
# - *
9+
# pull_request:
10+
# paths:
11+
# - .github/workflows/lambda-runner-binaries-syncer.yml
12+
# - "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/**"
13+
14+
jobs:
15+
build_syncer:
16+
name: Build runner binaries syncer
17+
runs-on: ubuntu-latest
18+
container: node:12
19+
env:
20+
lambda_name: runner-binaries-syncer
21+
lambda_path: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer
22+
defaults:
23+
run:
24+
working-directory: ${{ env.lambda_path }}
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Install dependencies
28+
run: yarn install && yarn dist
29+
- name: Upload distribution
30+
if: startsWith(github.ref, 'refs/tags/')
31+
uses: actions/upload-artifact@v1
32+
with:
33+
name: ${{ github.job }}
34+
path: ${{ env.lambda_path }}/dist
35+
36+
build_webhook:
37+
name: Build webhook distribution
38+
runs-on: ubuntu-latest
39+
container: node:12
40+
env:
41+
lambda_name: webhook
42+
lambda_path: modules/webhook/lambdas/webhook
43+
defaults:
44+
run:
45+
working-directory: ${{ env.lambda_path }}
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Install dependencies
49+
run: yarn install && yarn dist
50+
- name: Upload distribution
51+
if: startsWith(github.ref, 'refs/tags/')
52+
uses: actions/upload-artifact@v1
53+
with:
54+
name: ${{ github.job }}
55+
path: ${{ env.lambda_path }}/dist
56+
57+
build_runners:
58+
runs-on: ubuntu-latest
59+
container: node:12
60+
env:
61+
lambda_name: scale-runners
62+
lambda_path: modules/scale-runners/lambdas/scale-runners
63+
defaults:
64+
run:
65+
working-directory: ${{ env.lambda_path }}
66+
steps:
67+
- uses: actions/checkout@v2
68+
- name: Install dependencies
69+
run: yarn install && yarn dist
70+
- name: Upload distribution
71+
if: startsWith(github.ref, 'refs/tags/')
72+
uses: actions/upload-artifact@v1
73+
with:
74+
name: ${{ github.job }}
75+
path: ${{ env.lambda_path }}/dist
76+
# release_draft:
77+
# name: Create Draft Release
78+
# needs: build
79+
# runs-on: ubuntu-latest
80+
# container: node:12
81+
# if: startsWith(github.ref, 'refs/tags/')
82+
# steps:
83+
# - name: Create Release
84+
# uses: actions/create-release@latest
85+
# env:
86+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
87+
# with:
88+
# tag_name: ${{ github.ref }}
89+
# release_name: Release ${{ github.ref }}
90+
# draft: true
91+
# prerelease: true
92+
# - uses: actions/checkout@v2
93+
# - name: Extract tag name
94+
# id: tag_name
95+
# run: echo ::set-output name=TAG::${GITHUB_REF##*/}
96+
# - uses: actions/download-artifact@v2
97+
# with:
98+
# name: dist
99+
# path: dist
100+
# - name: Create zip
101+
# run: |
102+
# apt update && apt install zip
103+
# cd dist && zip -r ../${lambda_name}.zip .
104+
# - name: Create Release
105+
# id: create_release
106+
# uses: actions/create-release@latest
107+
# env:
108+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
109+
# with:
110+
# tag_name: ${{ github.ref }}
111+
# release_name: Release ${{ github.ref }}
112+
# draft: true
113+
# prerelease: true
114+
# - name: Upload Release Asset
115+
# id: upload-release-asset
116+
# uses: actions/upload-release-asset@v1
117+
# env:
118+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
# with:
120+
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
121+
# asset_path: ${{ env.lambda_name }}.zip
122+
# asset_name: ${{ env.lambda_name }}-${{ steps.tag_name.outputs.TAG }}.zip
123+
# asset_content_type: application/zip

0 commit comments

Comments
 (0)