only run action on tag push #8
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: Jar | |
on: push | |
jobs: | |
build: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ${{ matrix.os }} | |
env: | |
LANG: en_US.UTF-8 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
java: [17] | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
# java: [8, 11, 17, 21] | |
steps: | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
- name: Checkout | |
run: | | |
git clone https://github.com/$GITHUB_REPOSITORY.git repo | |
- name: Build | |
run: | | |
cd repo | |
./gradlew jar sourcesJar javadocJar | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: repo/lib/build/libs/*.jar |