Build Release Binaries #33
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
name: Build Release Binaries | |
on: | |
workflow_dispatch: | |
jobs: | |
create-mac-package: | |
name: Create Package On ${{ matrix.os }} - ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-13, macos-latest ] | |
include: | |
- os: macos-13 | |
arch: x64 | |
name: macOS x86_64 | |
- os: macos-latest | |
arch: aarch64 | |
name: macOS aarch64 | |
permissions: | |
contents: write | |
steps: | |
# Setup Java environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
# Check out current repository | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history | |
tags: true # Fetch all tags | |
# Install p7zip tool | |
- name: Install p7zip | |
run: brew install p7zip | |
# Unzip the 7z file | |
- name: Unzip 7z file | |
run: 7z x ./resources/common/dictionary/ecdict.7z -o./resources/common/dictionary/ | |
# Delete the original 7z file | |
- name: Delete 7z file | |
run: rm ./resources/common/dictionary/ecdict.7z | |
# Add execute permissions to gradlew | |
- name: Set execute permissions on gradlew | |
run: chmod +x ./gradlew | |
# Build Desktop Packaged application | |
- name: Desktop App Package | |
run: ./gradlew packageDmg | |
# Get the latest tag | |
- name: Get latest tag | |
id: latesttag | |
run: | | |
TAG=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null || echo "1.0.0") | |
echo "TAG=$TAG" >> $GITHUB_ENV | |
# Create a Draft Release | |
- name: Draft Release | |
uses: ncipollo/release-action@v1 | |
with: | |
draft: true | |
allowUpdates: true | |
generateReleaseNotes: false #自动生成发行说明。 | |
tag: "${{ env.TAG }}" | |
artifacts: "${{ github.workspace }}/build/compose/binaries/main/dmg/*.dmg" | |
token: ${{ secrets.GITHUB_TOKEN }} |