native image windows release #39
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: native image windows release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
# 暂时跳过 windows-latest | |
os: [ windows-latest] | |
name: build - ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: GitHub Action for GraalVM JDK 21 | |
uses: graalvm/[email protected] | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
- name: Cache local Maven repository | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build with Maven | |
run: mvn clean -X -U --file pom.xml --no-transfer-progress package -DskipTests | |
# 压缩文件 | |
- name: Archive zip | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
path: 'target/binfast-apijson-*' | |
filename: binfast-apijson-${{ matrix.os }}.zip | |
exclusions: 'target/binfast-apijson-*.txt' | |
# 上传构建产物 | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: binfast-apijson-${{ matrix.os }}.zip | |
path: binfast-apijson-${{ matrix.os }}.zip | |
# GitHub 上创建 release | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: binfast-apijson-${{ matrix.os }}.zip | |
prerelease: true | |
token: ${{ secrets.GH_TOKEN }} |