diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/beta.yml | 7 | ||||
-rw-r--r-- | .github/workflows/buildrelease.yml | 32 |
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 |