update to 1.21 #8
Workflow file for this run
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: Gradle Package | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
changelog: | |
name: Generate changelog | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Generate changelog | |
run: /bin/sh ./changes.sh ${{ github.ref_name }} ./changelog.out.md | |
- name: Upload changelog | |
uses: actions/upload-artifact@v3 | |
with: | |
name: changelog | |
path: ./changelog.out.md | |
retention-days: 5 | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: [ changelog ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Download changelog | |
uses: actions/download-artifact@v3 | |
with: | |
name: changelog | |
- name: Publish to GitHub Packages | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: publish | |
cache-read-only: false | |
env: | |
USERNAME: ${{ github.actor }} | |
TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CS_USERNAME: "codedsakura" | |
CS_TOKEN: ${{ secrets.CODEDSAKURA_MAVEN_TOKEN }} | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
CHANGELOG_PATH: "./changelog.out.md" | |
- name: Upload build output (libs) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libs | |
path: build/libs/ | |
- name: Upload build output (devlibs) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: devlibs | |
path: build/devlibs/ | |
release: | |
name: Create a release | |
runs-on: ubuntu-latest | |
needs: [ changelog, build ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download build output | |
uses: actions/download-artifact@v3 | |
with: | |
name: changelog | |
- name: Download libs | |
uses: actions/download-artifact@v3 | |
with: | |
name: libs | |
path: build/libs/ | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "build/libs/*.jar" | |
prerelease: false | |
token: ${{ secrets.PA_TOKEN }} | |
bodyFile: ./changelog.out.md |