Skip to content

更新版本号到 2.6.0 #6

更新版本号到 2.6.0

更新版本号到 2.6.0 #6

name: Build MacOS Package
on:
workflow_dispatch: # Manual trigger
push: # Tag-based trigger
tags:
- '*'
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
# 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
- name: Upload Artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: macos-package-${{ matrix.arch }}
path: build/compose/binaries/main/dmg/*.dmg
# Create a Draft Release
- name: Draft Release
if: github.event_name != 'workflow_dispatch'
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 }}