From 7d93f67afcc1856de9a28af07a4ad2e138387399 Mon Sep 17 00:00:00 2001 From: LifeIsAParadox Date: Fri, 15 Oct 2021 01:24:13 +0200 Subject: changed workflow + update to 1.2.1 the assets are now automatically uploaded on github release (github and modrinth) --- .github/workflows/beta.yml | 7 ++++++- .github/workflows/buildrelease.yml | 32 +++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 2d24d401..54292277 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -1,6 +1,11 @@ name: Build Beta -on: [ push, pull_request ] +on: + push: + branches: + - '**' + pull_request: + jobs: # This workflow contains a single job called "build" diff --git a/.github/workflows/buildrelease.yml b/.github/workflows/buildrelease.yml index a74f6d9c..546a6174 100644 --- a/.github/workflows/buildrelease.yml +++ b/.github/workflows/buildrelease.yml @@ -32,4 +32,34 @@ jobs: - uses: actions/upload-artifact@v2 with: name: Artifacts - path: build/libs/ \ No newline at end of file + path: build/libs/ + + - name: Read Changelog + id: read_changelog + shell: bash + run: | + CHANGELOG=$(sed '/___/Q' CHANGELOG.md | grep -v '# ') + echo "Changelog:\n$CHANGELOG" + CHANGELOG="${CHANGELOG//'%'/'%25'}" + CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" + CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" + echo "::set-output name=changelog::$CHANGELOG" + + - uses: actions/github-script@v2 + id: fname + with: + result-encoding: string + script: | + const fs = require("fs") + return fs.readdirSync("build/libs/").filter(e => !e.endsWith("dev.jar") && !e.endsWith("sources.jar") && e.endsWith(".jar"))[0] + + - uses: softprops/action-gh-release@v1 + with: + body: ${{ steps.read_changelog.outputs.changelog }} + files: build/libs/${{ steps.fname.outputs.result }} + + - name: Publish to Modrinth + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + CHANGELOG: ${{ steps.read_changelog.outputs.changelog }} + run: ./gradlew publishModrinth \ No newline at end of file -- cgit