Skip to content

Commit

Permalink
update release workflow (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
PssbleTrngle authored Aug 25, 2023
1 parent 6f1ff04 commit 7ac419c
Showing 1 changed file with 19 additions and 33 deletions.
52 changes: 19 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,44 @@ jobs:
build:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin

- run: chmod +x ./gradlew

- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Update mod version
uses: christian-draeger/write-properties@1.0.1
with:
path: 'gradle.properties'
property: 'version'
property: 'mod_version'
value: ${{ github.event.release.tag_name }}

- name: Build
- name: Build and upload
uses: gradle/gradle-build-action@v2
with:
arguments: build curseforge modrinth publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
CHANGELOG: ${{ github.event.release.body }}
run: ./gradlew build curseforge modrinth
CI: true

- name: Upload forge jar to release
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: Forge/build/libs/skygrid-forge-${{ github.event.release.tag_name }}.jar
asset_name: skygrid-forge-${{ github.event.release.tag_name }}.jar
asset_content_type: application/java-archive
file: forge/build/libs/skygrid-forge-${{ github.event.release.tag_name }}.jar

- name: Upload fabric jar to release
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: Fabric/build/libs/skygrid-fabric-${{ github.event.release.tag_name }}.jar
asset_name: skygrid-fabric-${{ github.event.release.tag_name }}.jar
asset_content_type: application/java-archive
file: fabric/build/libs/skygrid-fabric-${{ github.event.release.tag_name }}.jar

0 comments on commit 7ac419c

Please sign in to comment.