-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (76 loc) · 2.84 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
76
---
name: Release
'on':
push:
tags:
- '*'
jobs:
release:
name: Create Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-10.15
shasum: shasum -a 512
- os: ubuntu-20.04
shasum: sha512sum
- os: windows-2019
shasum: sha512sum
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.0
- name: Set BCBSN deliverable environment variable
run: echo "bcbsn-deliverable=bcbsn-${{ matrix.os }}" >> $GITHUB_ENV
if: |
${{ startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') }}
- name: Set BCBSN deliverable environment variable on Windows
run: echo "bcbsn-deliverable=bcbsn-${{ matrix.os }}" >> $env:GITHUB_ENV
if: ${{ startsWith(matrix.os, 'windows') }}go
- name: Use the value
run: |
echo "${{ env.bcbsn-deliverable }}"
- name: Check whether all versions have been updated
run: |
version=$(echo "${{ github.ref }}" | sed -e "s|.*\/\(.*\)$|\1|")
echo "Version: ${version}"
echo "Checking README.md..."
grep "bcbsn:${version}" README.md
# yamllint disable rule:line-length
if: ${{ startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') }}
- name: Create release
run: ./scripts/build.sh
env:
BCBSN_DELIVERABLE: ${{ env.bcbsn-deliverable }}
GITHUB_TAG: ${{ github.ref }}
SHA512_CMD: ${{ matrix.shasum }}
if: ${{ startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') }}
- name: Create release windows
shell: cmd
run: |
echo "GITHUB_TAG: '${{ github.ref }}'"
echo "BCBSN_DELIVERABLE: '${{ env.bcbsn-deliverable }}'"
cd cmd/bcbsn
go build -buildvcs=false -ldflags "-X main.Version=${{ github.ref }}" -o "${{ env.bcbsn-deliverable }}"
sha512sum "${{ env.bcbsn-deliverable }}" > "${{ env.bcbsn-deliverable }}.sha512.txt"
chmod +x "${{ env.bcbsn-deliverable }}"
ls bcbsn-windows-2019
if: ${{ startsWith(matrix.os, 'windows') }}
# yamllint enable rule:line-length
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: cmd/bcbsn/${{ env.bcbsn-deliverable }}
asset_name: ${{ env.bcbsn-deliverable }}
tag: ${{ github.ref }}
- name: Upload checksums
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: cmd/bcbsn/${{ env.bcbsn-deliverable }}.sha512.txt
asset_name: ${{ env.bcbsn-deliverable }}.sha512.txt
tag: ${{ github.ref }}