Adjust actions workflow

This commit is contained in:
Jason Penilla committed 2023-04-16 09:56:38 -07:00
1 parent f9e0d6bce5
commit 839e6804e5
1 file changed
+7 -19
+7 -19
View File
@@ -5,7 +5,7 @@ on:
tags: [ "v**" ] tags: [ "v**" ]
pull_request: pull_request:
release: release:
types: [ released ] types: [ published ]
jobs: jobs:
build: build:
@@ -60,38 +60,26 @@ jobs:
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Create changelog and Pre-Release - name: Create changelog and Pre-Release
if: "${{ github.event_name == 'push' && contains(github.ref, '-beta.') }}" if: "${{ github.event_name == 'push' && contains(github.ref, '-beta.') }}"
id: make-changelog uses: MC-Machinations/[email protected]
uses: Hexaoxide/auto-release-changelog@changelog_output
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_RELEASE_TOKEN }}
title: CarbonChat ${{ steps.vars.outputs.tag }} title: CarbonChat ${{ steps.vars.outputs.tag }}
pre-release: true pre-release: true
files: | files: |
build/libs/carbonchat-paper-*.jar build/libs/carbonchat-paper-*.jar
build/libs/carbonchat-velocity-*.jar build/libs/carbonchat-velocity-*.jar
- name: Choose changelog
id: changelog
env:
FROM_RELEASE: ${{ github.event.release.body }}
GENERATED: ${{ steps.make-changelog.outputs.changelog }}
run: |
if [[ -z "$FROM_RELEASE" ]]; then
echo "CHANGELOG=$GENERATED" >> $GITHUB_ENV
else
echo "CHANGELOG=$FROM_RELEASE" >> $GITHUB_ENV
fi
- name: Publish (Pre-)Release to Modrinth - name: Publish (Pre-)Release to Modrinth
if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '-beta.'))) }}" if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
run: ./gradlew :carbonchat-paper:modrinth :carbonchat-velocity:modrinth run: ./gradlew :carbonchat-paper:modrinth :carbonchat-velocity:modrinth
env: env:
MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}" MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}"
RELEASE_NOTES: "${{ env.CHANGELOG }}" RELEASE_NOTES: "${{ github.event.release.body }}"
# - name: Publish (Pre-)Release to Hangar # - name: Publish (Pre-)Release to Hangar
# if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '-beta.'))) }}" # if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
# run: ./gradlew publishAllPublicationsToHangar # run: ./gradlew publishAllPublicationsToHangar
# env: # env:
# HANGAR_UPLOAD_KEY: "${{ secrets.HANGAR_UPLOAD_KEY }}" # HANGAR_UPLOAD_KEY: "${{ secrets.HANGAR_UPLOAD_KEY }}"
# RELEASE_NOTES: "${{ env.CHANGELOG }}" # RELEASE_NOTES: "${{ github.event.release.body }}"
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with: