Skip to content

Use reusable workflows #151

Use reusable workflows

Use reusable workflows #151

Workflow file for this run

name: Release
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/release.yml
- ./scripts/release_notes
- .goreleaser.yml
push:
tags:
- "v*"
jobs:
build-and-verify:
uses: Open-CMSIS-Pack/workflows-and-actions-collection/.github/workflows/[email protected]
with:
program: cpackget
test-matrix: '[{"platform":"windows-2022","arch":"amd64"},{"platform":"ubuntu-24.04","arch":"amd64"},{"platform":"macos-14","arch":"amd64"},{"platform":"ubuntu-24.04","arch":"arm64"}]'
go-version-file: ./go.mod
enable-qlty-coverage: false
goreleaser:
needs: [build-and-verify]
permissions:
contents: write # for goreleaser/goreleaser-action to create a GitHub release
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Download test results
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
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@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: testreport.zip
tag: ${{ github.ref }}
overwrite: true
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.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@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
version: latest
args: release ${{ github.event_name != 'push' && '--snapshot' || '' }} --clean --release-notes=/tmp/RELEASE_NOTES
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}