-
Notifications
You must be signed in to change notification settings - Fork 9
44 lines (36 loc) · 2.65 KB
/
release.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
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.20.1
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Set env
id: set_env
run: echo "RELEASE_VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Get dependencies
run: go mod download
- name: Run test
run: go test ./pkg/...
- name: Release to Github
run: |
./scripts/build.bash fitter fitter_${{ steps.set_env.outputs.RELEASE_VERSION }}
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-arm64
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_${{ steps.set_env.outputs.RELEASE_VERSION }}-darwin-amd64
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_${{ steps.set_env.outputs.RELEASE_VERSION }}-windows-amd64.exe
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-amd64
./scripts/build.bash cli fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-arm64
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-darwin-amd64
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-windows-amd64.exe
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-amd64