Skip to content

Commit

Permalink
Readd deployment with diff. branch args
Browse files Browse the repository at this point in the history
  • Loading branch information
bibi-reden committed Aug 2, 2024
1 parent 5785725 commit f3a8a29
Showing 1 changed file with 136 additions and 0 deletions.
136 changes: 136 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Deployment (J17)
on:
push:
branches:
- '*/*'
- '!dev'

jobs:
deployment:
env:
BRANCH_PREFIX: $(cat gradle.properties | grep mod_version | cut -d'+' -f2)
strategy:
matrix:
java: [17]
runs-on: ubuntu-latest
steps:
- name: check environment variables
run: env
- name: checkout repository
uses: actions/checkout@v3
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}'
run: ./gradlew build
- name: capture build artifacts (forge)
if: |
${{ matrix.java == '17' }}
github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}'
uses: actions/upload-artifact@v3
with:
name: Artifacts (Forge)
path: forge/build/libs/
- name: capture build artifacts (fabric)
if: |
${{ matrix.java == '17' }}
github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}'
uses: actions/upload-artifact@v3
with:
name: Artifacts (Fabric)
path: fabric/build/libs/
- name: get mod version
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}'
id: mod_version
run: |
archived_name=$(grep "archives_base_name" gradle.properties | cut -d'=' -f2 | tr -d '\n')
mod_version_val=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d '\n')
commitish_val=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | cut -d'-' -f1 | tr -d '\n')
echo "archive_name=$archived_name" >> $GITHUB_OUTPUT
echo "mod_version=$mod_version_val" >> $GITHUB_OUTPUT
echo "commitish=$commitish_val/main" >> $GITHUB_OUTPUT
- name: get minecraft version
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}'
id: minecraft_version
run: |
minecraft_version_val=$(grep "minecraft_version" gradle.properties | cut -d'=' -f2 | tr -d '\n')
echo "minecraft_version=$minecraft_version_val" >> $GITHUB_OUTPUT
- name: deploy fabric! (mc-publish)
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}'
uses: Kir-Antipov/[email protected]
with:
name: ${{ steps.mod_version.outputs.mod_version }}
files: |
fabric/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar
fabric/build/libs/*-@(dev|sources|javadoc|shadow).jar
github-files: |
fabric/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar
fabric/build/libs/*-@(dev|sources|javadoc|shadow).jar
modrinth-id: KCGxOJsE
curseforge-id: 955929

curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

github-tag: ${{ steps.mod_version.outputs.mod_version }}
github-token: ${{ secrets.REPOSITORY_TOKEN }}
github-commitish: ${{ steps.commitish.outputs.commitish }}

version: ${{ steps.mod_version.outputs.mod_version }}-fabric
changelog-file: CHANGELOG.md

loaders: |
fabric
quilt
dependencies: |
[email protected]+1.20.1(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github)
[email protected]+kotlin.1.8.22(required){modrinth:Ha28R6CL}{curseforge:308769}#(ignore:github)
game-versions: "${{ steps.minecraft_version.outputs.minecraft_version }}"
java: "${{ matrix.java }}"

- name: deploy forge! (mc-publish)
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}'
uses: Kir-Antipov/[email protected]
with:
name: ${{ steps.mod_version.outputs.mod_version }}

files: |
forge/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar
forge/build/libs/*-@(dev|sources|javadoc|shadow).jar
github-files: |
forge/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar
forge/build/libs/*-@(dev|sources|javadoc|shadow).jar
modrinth-id: KCGxOJsE
curseforge-id: 1019391

curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
modrinth-token: "${{ secrets.MODRINTH_TOKEN }}"

github-tag: ${{ steps.mod_version.outputs.mod_version }}
github-token: ${{ secrets.REPOSITORY_TOKEN }}
github-commitish: ${{ steps.commitish.outputs.commitish }}

version: ${{ steps.mod_version.outputs.mod_version }}-forge
changelog-file: CHANGELOG.md

loaders: |
forge
neoforge
dependencies: |
[email protected](required){modrinth:ordsPcFz}{curseforge:351264}#(ignore:github)
game-versions: "${{ steps.minecraft_version.outputs.minecraft_version }}"
java: "${{ matrix.java }}"

0 comments on commit f3a8a29

Please sign in to comment.