-
Notifications
You must be signed in to change notification settings - Fork 3
104 lines (88 loc) · 2.75 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
name: Release
on:
# Trigger the workflow on the new 'v*' tag created
push:
tags:
- "v*"
jobs:
create_release:
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref_name }}
draft: true
build_normal_artifacts:
needs: [create_release]
name: ${{ matrix.os }}/${{ github.ref }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macOS-latest, windows-latest]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set tag name
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: "v(.*)"
tagRegexGroup: 1
- name: Build executable
uses: freckle/stack-action@v4
id: stack
with:
stack-arguments: --copy-bins
- name: Set binary path name
id: binarypath
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
newEXE="trident-$RUNNER_OS.exe"
else
newEXE="trident-$RUNNER_OS"
fi
currentEXE="${{ steps.stack.outputs.local-bin }}/trident"
mv $currentEXE $newEXE
echo "BINARY_PATH=$newEXE" >> $GITHUB_OUTPUT
shell: bash
- name: Compress binary
uses: svenstaro/upx-action@v2
with:
files: ${{ steps.binarypath.outputs.BINARY_PATH }}
- name: Upload Release Asset
id: upload-release-asset
uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref_name }}
draft: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: ${{ steps.binarypath.outputs.BINARY_PATH }}
artifactContentType: application/octet-stream
build_centos_artifact:
needs: [create_release]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t linux -f .github/workflows/Dockerfile.centos .
- name: Create container
run: docker create --name linuxcontainer linux
- name: Copy executable
run: docker cp linuxcontainer:/root/.local/bin/trident trident-conda-linux
- name: Upload Release Asset
id: upload-release-asset
uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref_name }}
draft: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: trident-conda-linux
artifactContentType: application/octet-stream