This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
74 lines (68 loc) · 2.08 KB
/
arkctl_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
name: Arkctl Release Action
on:
workflow_dispatch:
inputs:
version:
description: 'version of current arkctl'
required: true
permissions:
contents: write
packages: write
jobs:
prepare:
name: Prepare for build
runs-on: ubuntu-latest
outputs:
is-tag-created: ${{steps.check_tag.outputs.exists}}
steps:
- uses: actions/checkout@v3
- name: Check if Tag Exists
id: check_tag
run: |
TAG_EXISTS=$(git ls-remote --tags origin arkctl-release-${{ github.event.inputs.version }})
if [ -z "$TAG_EXISTS" ]; then
echo "exists=False" >> $GITHUB_OUTPUT
else
echo "exists=True" >> $GITHUB_OUTPUT
fi
create-tag:
name: Create for branch if empty
if: needs.prepare.outputs.is-tag-created == 'False'
runs-on: ubuntu-latest
needs: ['prepare']
steps:
- name: Output variable
run: echo "Created Branch ${{needs.prepare.outputs.is-tag-created}} ?"
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTIONS_RUNNER_DEBUG: true
with:
tag_name: arkctl-release-${{ github.event.inputs.version }}
release_name: Release arkctl ${{ github.event.inputs.version }} binary!
release:
name: Release binary
runs-on: ubuntu-latest
if: always()
needs: ['prepare', 'create-tag']
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "1.21.3"
project_path: "./arkctl"
binary_name: "arkctl"
asset_name: "arkctl-${{ github.event.inputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}"
release_tag: "arkctl-release-${{ github.event.inputs.version }}"