-
Notifications
You must be signed in to change notification settings - Fork 15
72 lines (61 loc) · 2.02 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
name: Release
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/release.yml
- ./scripts/release_notes
- .goreleaser.yml
push:
tags:
- "v*"
permissions:
contents: read
jobs:
test:
uses: Open-CMSIS-Pack/cpackget/.github/workflows/test.yml@main
goreleaser:
permissions:
contents: write # for goreleaser/goreleaser-action to create a GitHub release
needs: test
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Download test results
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: test-results-*
path: testreport/
- name: Zip test reports
run: |
zip -r testreport.zip testreport
- name: Attach test reports to release assets
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: testreport.zip
tag: ${{ github.ref }}
overwrite: true
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
check-latest: true
- name: Generate release notes
run: |
./scripts/release_notes > /tmp/RELEASE_NOTES
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
version: latest
args: release ${{ github.event_name != 'push' && '--snapshot' || '' }} --clean --release-notes=/tmp/RELEASE_NOTES
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}