forked from sethvargo/gcs-cacher
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.07 KB
/
build.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
name: Build
on:
push:
branches:
- '**'
tags:
- '**'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17
- run: go build
- if: startsWith(github.ref, 'refs/tags/')
run: |
export VERSION="${github_ref/refs\/tags\/v/}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
tar -czvf gcs-cacher_${VERSION}_linux_amd64.tgz gcs-cacher
sha256sum gcs-cacher_${VERSION}_linux_amd64.tgz > gcs-cacher_${VERSION}_SHA256SUMS
env:
github_ref: ${{ github.ref }}
- if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: gcs-cacher_${{ env.VERSION }}_linux_amd64.tgz
path: ./gcs-cacher_${{ env.VERSION }}_linux_amd64.tgz
- if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: gcs-cacher_${{ env.VERSION }}_SHA256SUMS
path: ./gcs-cacher_${{ env.VERSION }}_SHA256SUMS