11name : Build (Multiple Arch)
22
33on :
4- push :
5- branches : [ develop ]
4+ push :
5+ branches : [ develop ]
6+ pull_request :
7+ branches : [ develop ]
8+ workflow_dispatch :
69
710jobs :
8- GoBuild :
9- runs-on : ubuntu-latest
10-
11- steps :
12- - name : Checkout
13- uses : actions/checkout@v4
14-
15- - name : Run Makefile
16- run : make
17-
18- - name : Upload win64
19- uses : actions/upload-artifact@v4
20- with :
21- name : win64
22- path : build/chibi_x64_win.exe
23-
24- - name : Upload Apple Silicon
25- uses : actions/upload-artifact@v4
26- with :
27- name : apple_silicon
28- path : build/chibi_darwin_silicon
29-
30- - name : Upload Apple Intel
31- uses : actions/upload-artifact@v4
32- with :
33- name : apple_intel
34- path : build/chibi_darwin_intel
35-
36- - name : Upload Debian
37- uses : actions/upload-artifact@v4
38- with :
39- name : debian
40- path : build/chibi_debian.deb
41-
42- - name : Upload Linux
43- uses : actions/upload-artifact@v4
44- with :
45- name : linux
46- path : build/chibi_x64_linux
11+ build :
12+ if : github.event_name == 'push' || github.event_name == 'pull_request'
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+
18+ - name : Run Make
19+ run : make
20+
21+ - name : Upload Artifacts
22+ uses : actions/upload-artifact@v4
23+ with :
24+ name : build
25+ path : build/*
26+
27+ create_release :
28+ if : github.event_name == 'workflow_dispatch'
29+ runs-on : ubuntu-latest
30+ needs : build
31+
32+ steps :
33+ - name : Download artifacts
34+ uses : actions/download-artifact@v4
35+ with :
36+ name : download-artifacts
37+
38+ - name : Read Version
39+ id : read_version
40+ run : |
41+ VERSION=$(cat version.txt)
42+ echo "Current version: $VERSION"
43+ echo "version=$VERSION" >> $GITHUB_ENV
44+
45+ - name : Create Release
46+ id : create-release
47+ 48+ env :
49+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+ with :
51+ tag_name : ${{ env.version }}
52+ release_name : Version ${{ env.version }} 🔖
53+ body : $(cat CHANGELOG.md)
54+ draft : false
55+ prerelease : false
56+
57+ - name : Upload Artifacts to Release
58+ 59+ with :
60+ asset_paths : ' [ "build/*" ]'
0 commit comments