11name : Release
22
33on :
4- workflow_dispatch :
54 push :
65 tags :
7- - " v*.*.* "
6+ - " v*"
87
98permissions :
109 contents : write
11-
10+ packages : write
1211jobs :
13- upload-assets :
12+ build :
13+ runs-on : ubuntu-latest
14+
1415 strategy :
1516 matrix :
1617 include :
17- - target : x86_64-unknown-linux-gnu
18- arch : amd64
19- os : ubuntu-latest
20- - target : aarch64-apple-darwin
21- arch : aarch64
22- os : macos-latest
23- - target : x86_64-pc-windows-msvc
24- arch : x64
25- os : windows-latest
26- runs-on : ${{ matrix.os }}
18+ - name : mono-engine
19+ context : .
20+ dockerfile : mono/Dockerfile
21+
22+ - name : ui
23+ context : moon
24+ dockerfile : moon/apps/web/Dockerfile
25+
26+ - name : orion-server
27+ context : .
28+ dockerfile : orion-server/Dockerfile
29+
2730 steps :
28- - name : Checkout repository
31+ - name : Checkout
2932 uses : actions/checkout@v4
30- with :
31- submodules : recursive
32- lfs : true
3333
34- - name : Install system dependencies
35- uses : ./.github/install-dep
34+ - name : Login GHCR
35+ uses : docker/login-action@v3
3636 with :
37- cache-key : sysdeps
38- platform : ${{ matrix.os }}
39-
40- - name : Building
41- run : |
42- cargo install --locked cargo-packager
43- cargo build --release --manifest-path libra/Cargo.toml
44- cargo packager --release --manifest-path monobean/Cargo.toml --config monobean/resources/packager_${{ matrix.target}}.toml
37+ registry : ghcr.io
38+ username : ${{ github.actor }}
39+ password : ${{ secrets.GITHUB_TOKEN }}
4540
46- - name : Prepare Linux
47- if : contains(matrix.os, 'ubuntu')
48- run : |
49- # makepkg monobean/target/build/
50- mv target/release/libra ${{ github.workspace }}/libra_${{ github.ref_name }}_${{ matrix.target }}
51- # mv monobean/target/build/Monobean__${{ matrix.arch }}.tar.gz.zst ${{ github.workspace }}/Monobean_${{ github.ref_name }}_${{ matrix.target }}.tar.gz.zst
52- mv monobean/target/build/monobean__${{ matrix.arch }}.deb ${{ github.workspace }}/Monobean_${{ github.ref_name }}_${{ matrix.target }}.deb
53-
54- - name : Prepare Windows
55- if : contains(matrix.os, 'windows')
56- run : |
57- mv target/release/libra.exe ${{ github.workspace }}/libra_${{ github.ref_name }}_${{ matrix.target }}.exe
58- mv monobean/target/build/monobean_0.0.1_${{ matrix.arch }}-setup.exe ${{ github.workspace }}/Monobean_${{ github.ref_name }}_${{ matrix.target }}.exe
41+ - name : Extract Tag
42+ id : tag
43+ run : echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
5944
60- - name : Prepare MacOS
61- if : contains(matrix.os, 'macos')
62- run : |
63- mv target/release/libra ${{ github.workspace }}/libra_${{ github.ref_name }}_${{ matrix.target }}
64- mv monobean/target/build/Monobean__${{ matrix.arch }}.dmg ${{ github.workspace }}/Monobean_${{ github.ref_name }}_${{ matrix.target }}.dmg
65-
66- - name : Release Linux
67- if : contains(matrix.os, 'ubuntu')
68- uses : softprops/action-gh-release@v2
45+ - name : Build and Push
46+ uses : docker/build-push-action@v5
6947 with :
70- token : ${{ secrets.GITHUB_TOKEN }}
71- draft : true
72- files : |
73- libra_${{ github.ref_name }}_${{ matrix.target }}
74- # Monobean_${{ github.ref_name }}_${{ matrix.target }}.tar.gz.zst
75- Monobean_${{ github.ref_name }}_${{ matrix.target }}.deb
48+ context : ${{ matrix.context }}
49+ file : ${{ matrix.dockerfile }}
50+ push : true
51+ tags : |
52+ ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}:${{ steps.tag.outputs.TAG }}
53+ ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}:latest
54+ create-release :
55+ runs-on : ubuntu-latest
56+ needs : build
57+ steps :
58+ - uses : actions/checkout@v4
7659
77- - name : Release Windows
78- if : contains(matrix.os, 'windows')
79- uses : softprops/action-gh-release@v2
80- with :
81- token : ${{ secrets.GITHUB_TOKEN }}
82- draft : true
83- files : |
84- libra_${{ github.ref_name }}_${{ matrix.target }}.exe
85- Monobean_${{ github.ref_name }}_${{ matrix.target }}.exe
60+ - name : Generate Release Notes
61+ run : |
62+ VERSION=${GITHUB_REF#refs/tags/}
63+ sed "s/\${VERSION}/$VERSION/g" .github/release-template.md > release.md
8664
87- - name : Release MacOS
88- if : contains(matrix.os, 'macos')
65+ - name : Create Release
8966 uses : softprops/action-gh-release@v2
9067 with :
91- token : ${{ secrets.GITHUB_TOKEN }}
92- draft : true
93- files : |
94- libra_${{ github.ref_name }}_${{ matrix.target }}
95- Monobean_${{ github.ref_name }}_${{ matrix.target }}.dmg
68+ body_path : release.md
69+ overwrite_files : true
0 commit comments