Files
norouter/.github/workflows/release.yml
Akihiro Suda 656e443867 Compress artifact binaries as tgz
- Old artifact name convention: "norouter-$(uname -s)-$(uname -m)"
- New artifact name convention: "norouter-$(uname -s)-$(uname -m).tgz"

The archive contains "norouter" executable.

On Windows, "norouter-$(uname -s)-$(uname -m).zip" contains "norouter.exe".

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-15 18:43:04 +09:00

63 lines
2.0 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
- 'test-action-release-*'
env:
GO111MODULE: on
jobs:
release:
strategy:
matrix:
go-version: [1.15.x]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- 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}"