Skip to content

Update to 1.21

Update to 1.21 #33

Workflow file for this run

name: Run tests and publish snapshot to Maven on push
on: [push]
jobs:
test_and_publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
loader: [forge, fabric, common]
env:
MOREMCMETA_MAVEN_USER: ${{ secrets.MOREMCMETA_MAVEN_USER }}
MOREMCMETA_MAVEN_PASS: ${{ secrets.MOREMCMETA_MAVEN_PASS }}
steps:
- uses: actions/checkout@3ba5ee6fac7e0e30e2ea884e236f282d3a775891
- uses: actions/setup-java@308abcba03229002f0055e17d79d00c32fca160f
with:
java-version: 21
distribution: temurin
- name: Determine mod version from branch or tag name
id: mod_version
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0
with:
script: |
const ref = context.payload.ref;
const branchOrTag = ref.substring(ref.lastIndexOf('/') + 1);
return branchOrTag + '-prerelease';
result-encoding: string
- name: Ensure Gradle wrapper is executable
run: chmod +x ./gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@9aa31f26bc8e536d1faf4b332bb8365350743a18
- name: Run tests
uses: gradle/gradle-build-action@cfc50b189af149aeb55f94103f47753382d88d33
with:
arguments: test
- name: Publish snapshot to GitHub Packages
uses: gradle/gradle-build-action@cfc50b189af149aeb55f94103f47753382d88d33
with:
arguments: :${{ matrix.loader }}:build :${{ matrix.loader }}:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MOD_VERSION: ${{ steps.mod_version.outputs.result }}