mirror of
https://github.com/norouter/norouter.git
synced 2025-12-24 13:17:54 +08:00
59 lines
1.9 KiB
YAML
59 lines
1.9 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
- 'test-action-release-*'
|
|
env:
|
|
GO111MODULE: on
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16.x
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
path: go/src/github.com/norouter/norouter
|
|
- name: "Compile binaries"
|
|
working-directory: go/src/github.com/norouter/norouter
|
|
run: make cross
|
|
- name: "SHA256SUMS"
|
|
working-directory: go/src/github.com/norouter/norouter
|
|
run: ( cd ./artifacts; sha256sum norouter-* ) | tee /tmp/SHA256SUMS
|
|
- name: "The sha256sum of the SHA256SUMS file"
|
|
run: sha256sum /tmp/SHA256SUMS
|
|
- name: "Prepare the release note"
|
|
working-directory: go/src/github.com/norouter/norouter
|
|
run: |
|
|
tag="${GITHUB_REF##*/}"
|
|
shasha=$(sha256sum /tmp/SHA256SUMS | awk '{print $1}')
|
|
cat << EOF | tee /tmp/release-note.txt
|
|
${tag}
|
|
|
|
#### Changes
|
|
(To be documented)
|
|
|
|
#### Install
|
|
\`\`\`
|
|
curl -fsSL https://github.com/${{ github.repository }}/releases/download/${tag}/norouter-\$(uname -s)-\$(uname -m).tgz | sudo tar xzvC /usr/local/bin
|
|
\`\`\`
|
|
|
|
#### About the binaries
|
|
The binaries were built automatically on GitHub Actions.
|
|
The build log is available for 90 days: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
|
|
The sha256sum of the SHA256SUMS file itself is \`${shasha}\` .
|
|
EOF
|
|
- name: "Create release"
|
|
working-directory: go/src/github.com/norouter/norouter
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
tag="${GITHUB_REF##*/}"
|
|
asset_flags=()
|
|
for f in ./artifacts/* /tmp/SHA256SUMS; do asset_flags+=("-a" "$f"); done
|
|
hub release create "${asset_flags[@]}" -F /tmp/release-note.txt --draft "${tag}"
|