-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# What Changed | ||
Whatever changed here | ||
|
||
## Release Notes | ||
If anything should be commented in the changelog release notes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "Pre-commit consistency check" | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }}-precommit | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit-check: | ||
name: Run pre-commit checks | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
list-files: shell | ||
filters: | | ||
addedOrModified: | ||
- added|modified: '**' | ||
# run only if changed files were detected | ||
- name: Run against changes | ||
uses: pre-commit/action@v3.0.0 | ||
if: steps.filter.outputs.addedOrModified == 'true' | ||
with: | ||
extra_args: --files ${{ steps.filter.outputs.addedOrModified_files }} | ||
|
||
# run if no changed files were detected (e.g. workflow_dispatch on master branch) | ||
- name: Run against all files | ||
uses: pre-commit/action@v3.0.0 | ||
if: steps.filter.outputs.addedOrModified != 'true' | ||
with: | ||
extra_args: --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
name: release-please | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
# https://github.com/google-github-actions/release-please-action in case more config is needed | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
command: manifest | ||
token: ${{ secrets.PAT }} | ||
# See how to configure file https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md | ||
# See output info at https://github.com/google-github-actions/release-please-action#configuration for variables | ||
|
||
# Possibly optimise this by building and then passing the folder across to these stages | ||
release: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
release-task: [curseforge, discordupload, modrinth] | ||
needs: release-please | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.release-please.outputs.release_created }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- name: Download MC assets | ||
run: ./gradlew downloadAssets || ./gradlew downloadAssets || (sleep 30s && ./gradlew downloadAssets) | ||
- name: Run DataGen | ||
run: ./gradlew runData | ||
- name: Build and publish (release) | ||
env: | ||
CURSE_API: ${{ secrets.CURSE_API }} | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
IS_RELEASE: true | ||
run: | | ||
# Build | ||
./gradlew build ${{ matrix.release-task }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
workflow_dispatch: | ||
name: Build | ||
jobs: | ||
snapshot: | ||
#if: ${{!startsWith(github.ref.split(’/’)[2], 'release-please')}} | ||
runs-on: ubuntu-latest | ||
# https://github.com/google-github-actions/release-please-action in case more config is needed | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# these if statements ensure that a publication only occurs when | ||
# a new release is created: | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- name: Build and upload preview (run for non-release builds) | ||
if: ${{ github.ref }} | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
run: | | ||
# Build | ||
./gradlew build discordupload |