Skip to content

Commit

Permalink
ci(Release): Publish Release (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
xMikux authored Sep 23, 2024
1 parent 3cb687f commit 2845a7c
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ jobs:
uses: ./.github/workflows/resuable_release_modrinth.yml
with:
version: ${{ needs.version-gen.outputs.version_sha_name }}
release_type: beta
secrets:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release | Publish Pack

on:
workflow_dispatch:
inputs:
debug:
description: "Generate debug log"
required: false
default: false
type: boolean

jobs:
version-gen:
name: Version Generator
uses: ./.github/workflows/resuable_version.yml
if: |
github.repository == 'xMikux/Slimefun-Resourcepack'
with:
release_type: "release"

config-upload:
name: Upload Item Models
uses: ./.github/workflows/resuable_configs.yml
if: |
github.repository == 'xMikux/Slimefun-Resourcepack'
ia-packer:
name: IA Packer
needs: [ version-gen ]
uses: ./.github/workflows/resuable_ia.yml
with:
debug: ${{ inputs.debug || false }}
pack_format_version_str: ${{ needs.version-gen.outputs.pack_version_name }}
secrets:
RCON_PASSWORD: ${{ secrets.RCON_PASSWORD }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}

res-packer:
name: Slimefun Packer
needs: [ ia-packer ]
uses: ./.github/workflows/resuable_packer.yml

res-publish-github:
name: Publish GitHub Release
needs: [ version-gen, config-upload, res-packer ]
uses: ./.github/workflows/resuable_release_gh.yml
with:
next_version: ${{ needs.version-gen.outputs.version_semver_next_name }}

res-publish-modrinth:
name: Publish Modrinth Release
needs: [ version-gen, res-publish-github ]
uses: ./.github/workflows/resuable_release_modrinth.yml
with:
version: ${{ needs.version-gen.outputs.version_semver_next_name }}
release_type: release
changelog: ${{ needs.res-publish-github.outputs.changelog }}
secrets:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
11 changes: 5 additions & 6 deletions .github/workflows/release_versionts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Release | Version Test

on:
workflow_dispatch: {}
push:

jobs:
version-gen-beta:
Expand All @@ -27,8 +26,8 @@ jobs:
- name: Act - Summary
run: |
echo "# Version Summary" >> $GITHUB_STEP_SUMMARY
echo "- Current Version: ${{ needs.version-gen-release.outputs.version_semver_current_name }}" >> $GITHUB_STEP_SUMMARY
echo "- Next Version: ${{ needs.version-gen-release.outputs.version_semver_next_name }}" >> $GITHUB_STEP_SUMMARY
echo "- SHA Version: ${{ needs.version-gen-release.outputs.version_sha_name }}" >> $GITHUB_STEP_SUMMARY
echo "- PackFormat - Beta: ${{ needs.version-gen-beta.outputs.pack_version_name }}" >> $GITHUB_STEP_SUMMARY
echo "- PackFormat - Release: ${{ needs.version-gen-release.outputs.pack_version_name }}" >> $GITHUB_STEP_SUMMARY
echo "- Current Version: `${{ needs.version-gen-release.outputs.version_semver_current_name }}`" >> $GITHUB_STEP_SUMMARY
echo "- Next Version: `${{ needs.version-gen-release.outputs.version_semver_next_name }}`" >> $GITHUB_STEP_SUMMARY
echo "- SHA Version: `${{ needs.version-gen-release.outputs.version_sha_name }}`" >> $GITHUB_STEP_SUMMARY
echo "- PackFormat - Beta: `${{ needs.version-gen-beta.outputs.pack_version_name }}`" >> $GITHUB_STEP_SUMMARY
echo "- PackFormat - Release: `${{ needs.version-gen-release.outputs.pack_version_name }}`" >> $GITHUB_STEP_SUMMARY
54 changes: 49 additions & 5 deletions .github/workflows/resuable_release_gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,60 @@ name: Resuable | GitHub Release
on:
workflow_call:
inputs:
release_type:
next_version:
type: string
required: false
default: "beta"
required: true
outputs:
changelog:
description: "Changelog markdown"
value: ${{ jobs.github_release.outputs.changelog }}

jobs:
github_release:
name: Release GitHub
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.changelog.outputs.changes }}
steps:
- name: abc
-
name: Artifact - Download Slimefun Resourcepack
uses: actions/download-artifact@v4
with:
path: workdir
merge-multiple: true
-
name: Name - Fix naming
run: |
abc
mv workdir/pack.zip Slimefun-ResourcePack.zip
mv workdir/*.zip .
ls -alh
-
name: GitHub - Create Draft Release
uses: ncipollo/[email protected]
with:
prerelease: true
draft: false
commit: ${{ github.sha }}
tag: ${{ inputs.next_version }}
name: ${{ inputs.next_version }}
body: "*pending*"
- name: Changelog - Generate Changelog
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ inputs.next_version }}
-
name: GitHub - Update Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
draft: false
makeLatest: true
tag: ${{ inputs.next_version }}
name: ${{ inputs.next_version }}
body: ${{ steps.changelog.outputs.changes }}
artifacts: |
Slimefun-ResourcePack.zip
item-models.zip
ia-addons.zip
23 changes: 20 additions & 3 deletions .github/workflows/resuable_release_modrinth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
version:
type: string
required: true
changelog:
type: string
required: false
default: ""
secrets:
MODRINTH_TOKEN:
required: true
Expand All @@ -32,15 +36,28 @@ jobs:
mv workdir/*.zip .
ls -alh
-
name: Modrinth - Relase Beta
name: Verify - Check Release Feature
id: verify
run: |
if [ "${{ inputs.release_type }}" == "beta" ]; then
released=false
elif [ "${{ inputs.release_type }}" == "release" ]; then
released=true
fi
echo "is_release=$released" >> "$GITHUB_OUTPUT"
-
name: Modrinth - Relase
uses: Kir-Antipov/[email protected]
with:
modrinth-id: TznkVJky
modrinth-featured: false
modrinth-featured: ${{ steps.verify.outputs.is_release }}
modrinth-unfeature-mode: subset
version: ${{ inputs.version }}
version-type: beta
version-type: ${{ inputs.release_type }}
loaders: minecraft
game-versions: ">=1.19"
changelog: |
${{ inputs.changelog }}
dependencies: |
otVJckYQ(recommended)
files: |
Expand Down

0 comments on commit 2845a7c

Please sign in to comment.