-
Notifications
You must be signed in to change notification settings - Fork 34
49 lines (47 loc) · 1.36 KB
/
release.yaml
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
name: "tagged-release"
on:
release:
types:
- published
jobs:
build-id:
runs-on: ubuntu-latest
outputs:
build-id: ${{steps.build-id.outputs.build-id}}
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/[email protected]
id: short-sha
- id: build-id
run: echo "build-id=${{ github.event.release.tag_name }}-${{ steps.short-sha.outputs.sha }}" >> "$GITHUB_OUTPUT"
ci:
uses: ./.github/workflows/build.yaml
needs: build-id
with:
# note >-, args needs to be strings to be used as inputs
# for the reusable build.yaml workflow
go-version: >-
["1.20.x"]
privilege-level: >-
["priv"]
build-id: "${{needs.build-id.outputs.build-id}}"
release:
name: "Tagged Release"
runs-on: ubuntu-20.04
# needs ci for the cached stacker binary
needs: [build-id, ci]
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: stacker
key: ${{needs.build-id.outputs.build-id}}
- if: github.event_name == 'release' && github.event.action == 'published'
name: Publish artifacts on releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: stacker
tag: ${{ github.ref }}
overwrite: true
file_glob: true