Skip to content

Commit

Permalink
update github action
Browse files Browse the repository at this point in the history
  • Loading branch information
plusls committed Dec 2, 2021
1 parent d3c4f04 commit d037a7b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
- name: Set build version
if: ${{ runner.os != 'Windows' }}
run: |
sed -i "s/pre_release = alpha/pre_release = beta/g" gradle.properties
sed -i "s/pre_release=alpha/pre_release=beta/g" gradle.properties
- name: capture build artifacts
if: ${{ runner.os == 'Linux'}}
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
uses: actions/upload-artifact@v2
with:
name: Artifacts
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Release
on:
release:
types:
- published
jobs:
build:
strategy:
matrix:
java: [ 17 ]
os: [ ubuntu-20.04 ]
branch: [ 1.16.x, 1.17.x, 1.18.x ]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Set build version
if: ${{ runner.os != 'Windows' }}
run: |
sed -i "s/pre_release=alpha/pre_release=/g" gradle.properties
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: Find correct JAR
id: findjar
run: |
output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
echo "::set-output name=jarname::$output"
- name: Upload assets to GitHub
uses: AButler/[email protected]
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
with:
files: build/libs/${{ steps.findjar.outputs.jarname }}
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d037a7b

Please sign in to comment.