Skip to content

Commit 7ffc1fd

Browse files
Add GitHub Actions workflow for releases
1 parent a651d86 commit 7ffc1fd

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Triggers on tags like v1.0, v2.1.3, etc.
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install dependencies (Linux)
19+
if: runner.os == 'Linux'
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y build-essential
23+
24+
- name: Build with Make
25+
working-directory: ./mas
26+
shell: bash
27+
run: make
28+
29+
# Determine the correct binary name per OS
30+
- name: Set binary name
31+
id: binary
32+
shell: bash
33+
run: |
34+
if [[ "${{ runner.os }}" == "Windows" ]]; then
35+
echo "name=mas.exe" >> $GITHUB_OUTPUT
36+
echo "path=mas/mas.exe" >> $GITHUB_OUTPUT
37+
else
38+
echo "name=mas" >> $GITHUB_OUTPUT
39+
echo "path=mas/mas" >> $GITHUB_OUTPUT
40+
fi
41+
42+
# Upload binary to the release
43+
- name: Upload release asset
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
files: ${{ steps.binary.outputs.path }}
47+
tag_name: ${{ github.ref_name }}
48+
draft: false
49+
prerelease: false
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)