forked from github-aws-runners/terraform-aws-github-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (76 loc) · 2.47 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release build
on:
push:
branches:
- master
- develop
jobs:
prepare:
name: Create dist
runs-on: ubuntu-latest
container: node:12
strategy:
matrix:
lambda: ["modules/webhook/lambdas/webhook", "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer", "modules/runners/lambdas/runners"]
steps:
- name: Extract lambda name
id: lambda
env:
LAMBDA: ${{ matrix.lambda }}
run: echo ::set-output name=name::${LAMBDA##*/}
- uses: actions/checkout@v2
- name: Add zip
run: apt update && apt install zip
- name: Build dist
working-directory: ${{ matrix.lambda }}
run: yarn install && yarn run test && yarn dist
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.lambda.outputs.name }}
path: ${{ matrix.lambda }}/${{ steps.lambda.outputs.name }}.zip
retention-days: 1
release:
runs-on: ubuntu-latest
needs:
prepare
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/download-artifact@v2
with:
name: webhook
path: artifacts
- uses: actions/download-artifact@v2
with:
name: runners
path: artifacts
- uses: actions/download-artifact@v2
with:
name: runner-binaries-syncer
path: artifacts
- name: Get installation token
uses: npalm/[email protected]
id: app-token
with:
appId: ${{ secrets.FOREST_RELEASER_APP_ID }}
appPrivateKeyBase64: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
appInstallationType: repo
appInstallationValue: ${{ github.repository }}
- name: Dry run release
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Read only token
run: |
cp .release/* .
yarn
yarn release -d --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git
- name: Release
if: github.event_name != 'pull_request' && contains('refs/heads/master', github.ref)
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
cp .release/* .
yarn
yarn release --repositoryUrl https://x-access-token:[email protected]/$GITHUB_REPOSITORY.git