-
Notifications
You must be signed in to change notification settings - Fork 264
58 lines (58 loc) · 1.69 KB
/
release_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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Release Build
on:
release:
types: [created]
jobs:
release:
strategy:
matrix:
type: [build, build_musl]
platform: [ubuntu-latest]
go-version: [1.20.1]
name: Release and Build
runs-on: ${{ matrix.platform }}
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
ref: main
- name: Build
uses: px-org/build-action@main
with:
type: ${{ matrix.type }}
go-version: ${{ matrix.go-version }}
artifact-name: "PanIndex"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{github.workspace}}/dist/compress/*
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
sha256:
runs-on: ubuntu-latest
needs: release
steps:
- name: Compress
run: |
mkdir -p ${{github.workspace}}/dist
cd ${{github.workspace}}/dist
assets=$(curl -s https://api.github.com/repos/px-org/PanIndex/releases/latest | jq -c '.assets[]' | jq -r '.browser_download_url')
for url in $assets
do
curl -L ${url} -O
done
for f in $(find * -type f -name "*"); do
sha256sum "$f" >> sha256.list
done
shell: bash
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{github.workspace}}/dist/sha256.list
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}