Actions 工作流 #1
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 | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java_version: [ 17 ] | |
runs-on: ubuntu-latest | |
name: Build (Java ${{ matrix.java_version }}) | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Java ${{ matrix.java_version }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java_version }} | |
- name: Prepare Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: Build | |
run: ./gradlew build | |
- name: Upload artifacts | |
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Artifacts | |
path: build/libs/ |