forked from artempyanykh/marksman
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (107 loc) · 3.39 KB
/
Copy pathrelease.yml
File metadata and controls
107 lines (107 loc) · 3.39 KB
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
106
107
name: Release
on:
workflow_dispatch:
inputs:
name:
description: "Release name"
required: true
jobs:
build:
name: Build the release for ${{ matrix.os.runner }} (${{ matrix.os.exe }})
runs-on: ${{ matrix.os.runner }}
strategy:
matrix:
os:
- runner: windows-latest
exe: marksman.exe
task: publishTo
- runner: ubuntu-latest
exe: marksman-linux-x64
task: publishTo RID=linux-x64
- runner: ubuntu-latest
exe: marksman-linux-musl-x64
task: publishTo RID=linux-musl-x64
- runner: ubuntu-latest
exe: marksman-linux-arm64
task: publishTo RID=linux-arm64
- runner: ubuntu-latest
exe: marksman-linux-musl-arm64
task: publishTo RID=linux-musl-arm64
- runner: macos-latest
exe: marksman
task: macosUniversalBinary
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Create release tag
run: |
git tag ${{ github.event.inputs.name }}
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: "9.0.x"
- name: Install dependencies
run: dotnet restore
- name: Build the release binary
run: make ${{ matrix.os.task }} DEST=out
- name: Rename linux binary
shell: python
run: |
import os
if ("${{ matrix.os.exe }}" != "marksman" and
"${{ matrix.os.exe }}" != "marksman.exe"
):
os.rename("out/marksman", "out/${{ matrix.os.exe }}")
- name: Upload the binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os.exe }}
path: out/${{ matrix.os.exe }}
if-no-files-found: error
release:
name: Create the release for ${{ matrix.os.runner }} (${{ matrix.os.release_exe }})
runs-on: ${{ matrix.os.runner }}
needs: build
strategy:
matrix:
os:
- runner: windows-latest
exe: marksman.exe
release_exe: marksman.exe
- runner: ubuntu-latest
exe: marksman-linux-x64
release_exe: marksman-linux-x64
- runner: ubuntu-latest
exe: marksman-linux-musl-x64
release_exe: marksman-linux-musl-x64
- runner: ubuntu-latest
exe: marksman-linux-arm64
release_exe: marksman-linux-arm64
- runner: ubuntu-latest
exe: marksman-linux-musl-arm64
release_exe: marksman-linux-musl-arm64
- runner: macos-latest
exe: marksman
release_exe: marksman-macos
steps:
- id: download
name: Download the release binary
uses: actions/download-artifact@v4
with:
name: ${{ matrix.os.exe }}
- name: Rename the binary
shell: python
run: |
import os
os.rename("${{ matrix.os.exe }}", "${{ matrix.os.release_exe }}")
- name: Create a GH release
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.os.release_exe }}
name: ${{ github.event.inputs.name }}
tag_name: ${{ github.event.inputs.name }}
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}