.github/workflows/release.yml #10
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
on: workflow_dispatch | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup jdk | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: gradle | |
- name: gradle setup | |
uses: gradle/gradle-build-action@v2 | |
- name: gradle build | |
run: ./gradlew build --no-daemon | |
- name: set params | |
run: | | |
cat $GITHUB_WORKSPACE/gradle.properties | grep ^archives_base_name= >> $GITHUB_ENV | |
cat $GITHUB_WORKSPACE/gradle.properties | grep ^minecraft_version= >> $GITHUB_ENV | |
cat $GITHUB_WORKSPACE/gradle.properties | grep ^mod_version= >> $GITHUB_ENV | |
- name: tag release | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/${{ env.mod_version }}', | |
sha: context.sha | |
}) | |
- name: publish to cf/modrinth | |
env: | |
CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }} | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
run: ./gradlew publish publishUnified --stacktrace --no-daemon |