-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (64 loc) · 1.77 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
name: Release
on:
release:
types:
- published
workflow_dispatch:
inputs:
target_release_tag:
description: The tag of the release you want to append the artifact to
type: string
required: true
env:
CARGO_TERM_COLOR: always
jobs:
show_action_parameters:
runs-on: ubuntu-latest
steps:
- name: Show action parameters
run: |
cat <<EOF > $GITHUB_STEP_SUMMARY
## Action Parameters
- target_release_tag: \`${{ github.event.inputs.target_release_tag }}\`
EOF
# ensure the input release tag is valid
validate_release:
runs-on: ubuntu-latest
steps:
- name: Get github release information
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: cardinalby/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag: ${{ github.event.inputs.target_release_tag }}
build:
uses: ./.github/workflows/build.yml
secrets: inherit
needs:
- validate_release
with:
release: true
release:
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Display context
run: |
echo ref_name = ${{ github.ref_name }}
echo target_release_tag = ${{ github.event.inputs.target_release_tag }}
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: build-artifacts
- name: Pack artifacts
run: |
cd build-artifacts
for dir in */; do zip -r "${dir%/}.zip" "$dir"; done
- uses: softprops/action-gh-release@v2
with:
files: build-artifacts/*
tag_name: ${{ github.event.inputs.target_release_tag }}