forked from github-aws-runners/terraform-aws-github-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (82 loc) · 2.61 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (82 loc) · 2.61 KB
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
83
84
85
86
87
88
89
90
91
name: Release build
on:
push:
branches:
- main
- v1
jobs:
prepare:
name: Create dist
runs-on: ubuntu-latest
container: node:16
strategy:
matrix:
lambda: ["modules/webhook/lambdas/webhook", "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer", "modules/runners/lambdas/runners"]
permissions:
contents: read
actions: write
steps:
- name: Extract lambda name
id: lambda
env:
LAMBDA: ${{ matrix.lambda }}
run: echo "name=${LAMBDA##*/}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- 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@v3
with:
name: ${{ steps.lambda.outputs.name }}
path: ${{ matrix.lambda }}/${{ steps.lambda.outputs.name }}.zip
retention-days: 1
release:
name: release
runs-on: ubuntu-latest
needs:
prepare
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Get installation token
uses: philips-software/app-token-action@v1.1.2
id: token
with:
app_id: ${{ secrets.FOREST_RELEASER_APP_ID }}
app_base64_private_key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
auth_type: installation
- name: Extract branch name
id: branch
shell: bash
run: echo "name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Release
id: release
uses: google-github-actions/release-please-action@5c07f8be172b1f6e90f9c35baf8184461b91b85f # ratchet:google-github-actions/release-please-action@v3
with:
default-branch: ${{ steps.branch.outputs.name }}
release-type: terraform-module
token: ${{ steps.token.outputs.token }}
assets:
name: upload assets
if: ${{ needs.release.outputs.releases_created }}
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
asset: ["webhook", "runner-binaries-syncer", "runners"]
permissions:
contents: write
actions: read
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.asset }}
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
gh release upload ${{ needs.release.outputs.tag_name }} ${{ matrix.asset }}.zip