-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
czyt
committed
Nov 9, 2024
1 parent
6a327bf
commit 6019001
Showing
2 changed files
with
58 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,58 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
draft: false | ||
prerelease: false | ||
generate_release_notes: true | ||
|
||
build-release: | ||
needs: release | ||
name: Build Release on ${{ matrix.os }} | ||
build: | ||
name: Build on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
artifact_name: rime-deploy-linux | ||
asset_name: rime-deploy-linux-x64 | ||
# Windows builds | ||
- os: windows-latest | ||
artifact_name: rime-deploy-windows.exe | ||
asset_name: rime-deploy-windows-x64.exe | ||
|
||
# macOS builds | ||
- os: macos-latest | ||
artifact_name: rime-deploy-macos | ||
asset_name: rime-deploy-macos-x64 | ||
- os: windows-latest | ||
artifact_name: rime-deploy-windows.exe | ||
asset_name: rime-deploy-windows-x64.exe | ||
|
||
# Linux builds | ||
- os: ubuntu-latest | ||
artifact_name: rime-deploy-linux | ||
asset_name: rime-deploy-linux-x64 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: | | ||
mkdir build && cd build | ||
cmake .. | ||
cmake --build . --config Release | ||
- name: Upload Release Asset | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: build/Release/${{ matrix.artifact_name }} | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Build Environment | ||
shell: bash | ||
run: | | ||
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential | ||
fi | ||
- name: Build | ||
shell: bash | ||
run: | | ||
make | ||
mkdir -p artifacts | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
cp rime-deploy.exe artifacts/${{ matrix.artifact_name }} | ||
else | ||
cp rime-deploy artifacts/${{ matrix.artifact_name }} | ||
chmod +x artifacts/${{ matrix.artifact_name }} | ||
fi | ||
- name: Upload Release Asset | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: artifacts/${{ matrix.artifact_name }} |