aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorLifeIsAParadox <LifeIsAParadox@users.noreply.github.com>2021-10-15 01:24:13 +0200
committerLifeIsAParadox <LifeIsAParadox@users.noreply.github.com>2021-10-15 01:24:13 +0200
commit7d93f67afcc1856de9a28af07a4ad2e138387399 (patch)
tree6932c3a0682facabea9b626dd76483b7d3af324c /.github/workflows
parent17a4e0804c3e07472a7ebdfa17142dbd16ba5d67 (diff)
downloadSkyblocker-7d93f67afcc1856de9a28af07a4ad2e138387399.tar.gz
Skyblocker-7d93f67afcc1856de9a28af07a4ad2e138387399.tar.bz2
Skyblocker-7d93f67afcc1856de9a28af07a4ad2e138387399.zip
changed workflow + update to 1.2.1
the assets are now automatically uploaded on github release (github and modrinth)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/beta.yml7
-rw-r--r--.github/workflows/buildrelease.yml32
2 files changed, 37 insertions, 2 deletions
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