Release addon #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: Release addon | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '21' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build --full-stacktrace | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Artifacts | |
path: build/libs/*-release.jar | |
- name: Get Addon Version | |
id: version | |
uses: notiz-dev/github-action-json-property@release | |
with: | |
path: 'core/src/main/resources/transporter/updateInfo.json' | |
prop_path: 'version' | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: v${{steps.version.outputs.prop}} | |
release_name: Transporter Addon ${{steps.version.outputs.prop}} | |
body: | | |
Klik under for at hente dette release | |
draft: true | |
prerelease: false | |
- name: Copy Artifact | |
run: mv build/libs/TransporterAddon-release.jar release/transporter-laby4.jar | |
- name: Upload Transporter Build To Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: release/transporter-laby4.jar | |
asset_name: transporter-laby4.jar | |
asset_content_type: application/jar | |
- name: Upload updateInfo.json To Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: core/src/main/resources/transporter/updateInfo.json | |
asset_name: updateInfo.json | |
asset_content_type: application/json |