Skip to content

Commit

Permalink
Add manual workflow dispatch for merge, build and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed May 30, 2023
1 parent cd7f46b commit 1b05ea1
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/merge-build-publish-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

name: 'Manual Merge, Build and Publish'
on: [workflow_dispatch]
permissions:
contents: write
jobs:
merge:
name: Merge the PR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Find Pull Request
uses: juliangruber/find-pull-request-action@v1
id: find-pull-request
with:
branch: l10n_main
- name: Merge Pull Request
if: steps.find-pull-request.outputs.number != ''
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
number: '${{ steps.find-pull-request.outputs.number }}'
method: squash
repo: '${{ github.repository }}'
version:
name: Bump Version
runs-on: ubuntu-latest
needs:
- merge
outputs:
tag: '${{ steps.bump.outputs.tag }}'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Bump Version
id: bump
uses: anothrNick/github-tag-action@d77194f92b4ca48b05df5c20709984535a9cd6e0
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
WITH_V: true
publish:
name: Build Resource Pack
runs-on: ubuntu-latest
needs:
- version
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Create Resource Pack File
run: (cd Sodium\ Translations && zip -r "../SodiumTranslations.zip" *)
- name: Generate Checksum
run: >-
sha1sum "SodiumTranslations.zip" | cut -d " " -f 1 >
"SodiumTranslations.zip.sha1sum"
- name: Store Artifacts
uses: actions/upload-artifact@v3
with:
name: Resource Pack
path: SodiumTranslations.zip*
- name: Release on GitHub
uses: softprops/action-gh-release@c9b46fe7aad9f02afd89b12450b780f52dacfb2d
with:
tag_name: '${{ needs.version.outputs.tag }}'
generate_release_notes: true
files: SodiumTranslations.zip*
- name: Release on Modrinth
uses: Kir-Antipov/[email protected]
with:
modrinth-id: yfDziwn1
modrinth-token: '${{ secrets.MODRINTH_TOKEN }}'
files: |
SodiumTranslations.zip
dependencies: |
sodium(required){modrinth:AANobbMI}{curseforge:394468}#(ignore:curseforge,github)

0 comments on commit 1b05ea1

Please sign in to comment.