-
-
Notifications
You must be signed in to change notification settings - Fork 80
105 lines (87 loc) · 2.71 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Main
on: push
env:
release_name: 2.0-${{github.run_number}}
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: golang gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
version: 1.0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '^1.20.x'
check-latest: true
cache: true
- name: Install Go Packages
run: |
go mod tidy
- name: Build
run: GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o cryo_utilities ./cmd/cryoutilities
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{env.release_name}}
path: cryo_utilities
main-release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Artifact
uses: actions/download-artifact@v3
id: download
with:
name: ${{env.release_name}}
- name: Generate Checksum
run: md5sum cryo_utilities > cu.md5
- name: Delete Previous Latest Release
uses: dev-drprasad/[email protected]
with:
tag_name: latest
delete_release: true
repo: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Unique Release
shell: bash
run: hub release create ${{ env.release_name }} -m ${{ env.release_name }} -a cryo_utilities -a cu.md5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Latest Release
shell: bash
run: hub release create latest -m latest -a cryo_utilities -a cu.md5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dev-release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Artifact
uses: actions/download-artifact@v3
id: download
with:
name: ${{env.release_name}}
- name: Delete Previous Develop Release
uses: dev-drprasad/[email protected]
with:
tag_name: develop
delete_release: true
repo: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Develop Release
shell: bash
run: hub release create develop -m develop -a cryo_utilities
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}