Skip to content

Commit

Permalink
use scripts from example mod and rename branch used (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Caedis authored Dec 16, 2023
1 parent 6e030a7 commit abc0b9f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/update_version
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ if ! git diff --name-only HEAD HEAD~1 | grep -qF 'build.gradle'; then
printf 'Updated buildscript version to %s\n' "$new_version"
else
printf 'Ignored buildscript version update: no changes detected\n'
fi
fi
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Build and test

on:
pull_request:
branches: [ 1.7.10, 1.7.10-dev ]
branches: [ master, main ]
push:
branches: [ 1.7.10, 1.7.10-dev ]
branches: [ master, main ]

jobs:
build-and-test:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
secrets: inherit
secrets: inherit
66 changes: 3 additions & 63 deletions .github/workflows/release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,6 @@ permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout mod repo
uses: actions/checkout@v3
with:
fetch-depth: 32

- name: Set release version
run: |
IFS='-' read -r mv pv <<< "${GITHUB_REF#refs/*/}"
echo "MC_VERSION=${mv}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${pv}" >> $GITHUB_ENV
echo "VERSION=${pv}" >> $GITHUB_ENV
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Setup the workspace
run: ./gradlew --info --stacktrace ${{ inputs.workspace }}

- name: Build the mod
run: ./gradlew --info --stacktrace build

# Continue on error in the following steps to make sure releases still get made even if one of the methods fails

- name: Delete old release if it already exists
run: gh release delete --yes "${MC_VERSION}-${RELEASE_VERSION}"
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release under current tag
run: |
export "CHANGELOG_FILE=$(mktemp --suffix=.md)"
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV
gh api --method POST -H "Accept: application/vnd.github+json" \
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
-f tag_name="${MC_VERSION}-${RELEASE_VERSION}" \
--jq ".body" > "${CHANGELOG_FILE}"
cat "${CHANGELOG_FILE}"
gh release create "${MC_VERSION}-${RELEASE_VERSION}" -F "${CHANGELOG_FILE}" ./build/libs/*.jar
shell: bash
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to Maven, Modrinth and CurseForge
run: ./gradlew --info --stacktrace build publish
continue-on-error: true
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
if: ${{ env.MAVEN_USER != '' }}
release-tags:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
secrets: inherit

0 comments on commit abc0b9f

Please sign in to comment.