-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (54 loc) · 1.82 KB
/
publish_executables.yaml
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
name: publish executables
on:
push:
branches: [main]
tags: ["v*"]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: checkout the source code
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ^1.20
- name: Cache go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build executable bundles
run: ./scripts/publish_executables.sh
- name: generate a build timestamp and sha256sum files
run: |
cd builds
echo `date -u +'%Y%m%d%H%M%S'` > ./build_timestamp.txt
echo `date -u +'%Y-%m-%dT%H:%M:%S%:z'` >> ./build_timestamp.txt
sha256sum *.tar.gz > ./SHA256SUMS.txt
sha256sum *.zip >> ./SHA256SUMS.txt
- name: update release notes and executables
if: startsWith(github.ref, 'refs/tags/') # executes only for new release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
files: |
builds/*.tar.gz
builds/*.zip
builds/build_timestamp.txt
builds/SHA256SUMS.txt
- name: Update executables for main branch changes
if: startsWith(github.ref, 'refs/heads/main') # executes only for changes in main
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GH_TOKEN }}"
automatic_release_tag: development
prerelease: true
title: "Development Build - Pre Release"
files: |
builds/*.tar.gz
builds/*.zip
builds/build_timestamp.txt
builds/SHA256SUMS.txt