Skip to content

Commit 6178e29

Browse files
Sync Workflows
1 parent 79628e5 commit 6178e29

4 files changed

Lines changed: 83 additions & 13 deletions

File tree

.github/workflows/auto-build.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Latest Build
33
on:
44
push:
55
branches: ['1.20.1', '1.21']
6-
paths-ignore: ['.github/**', '**/*.md']
6+
paths: ['src/**', '**/*.gradle', 'gradle.properties']
77

88
concurrency:
99
group: auto-build-${{ github.ref }}
@@ -13,24 +13,29 @@ jobs:
1313
build:
1414
runs-on: ubuntu-latest
1515
env:
16+
GITHUB_TOKEN: ${{ github.token }}
1617
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
1718
MAVEN_USER: ${{ secrets.MAVEN_USER }}
1819
SNAPSHOT: true
19-
GITHUB_TOKEN: ${{ github.token }}
2020
permissions:
2121
contents: write
2222
steps:
2323
- uses: actions/checkout@v4
2424
- name: Setup Build
2525
uses: ./.github/actions/build_setup
26-
- name: Get Version
26+
- name: Get Mod Version
2727
id: ver
2828
run: echo "version=$(./gradlew -q printVersion)" >> $GITHUB_OUTPUT
29+
- name: Version Suffix
30+
id: suffix
31+
run: echo "VERSION_SUFFIX=$(echo "${{ github.sha }}" | cut -c 1-7)" >> $GITHUB_ENV
2932
- name: Build
3033
run: ./gradlew build --build-cache
3134
- name: Publish to Maven
3235
if: github.repository_owner == 'GregTechCEu'
3336
run: ./gradlew publish --build-cache
37+
- name: Rename Jars
38+
run: for file in build/libs/*; do mv "$file" "${file/SHOT/SHOT-$(date --utc '+%Y%m%d-%H%M%S')-${{ env.VERSION_SUFFIX }}}"; done;
3439
- name: Upload Artifacts
3540
uses: actions/upload-artifact@v4
3641
with:
@@ -51,10 +56,10 @@ jobs:
5156
uses: andelf/nightly-release@46e2d5f80828ecc5c2c3c819eb31186a7cf2156c
5257
with:
5358
tag_name: latest-${{ github.ref_name }}
54-
name: '${{ github.ref_name }}-${{ steps.ver.outputs.version}} SNAPSHOT $$'
59+
name: '${{ github.ref_name }}-${{ steps.ver.outputs.version}} SNAPSHOT ${{ env.VERSION_SUFFIX }}'
5560
prerelease: true
5661
body: |
5762
The latest build of GTM for Minecraft ${{ github.ref_name }}.
5863
Please report any [issues](https://github.com/GregTechCEu/GregTech-Modern/issues).
5964
${{ steps.changelog.outputs.changelog }}
60-
files: build/libs/*.jar
65+
files: build/libs/*.jar

.github/workflows/build-on-push.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ concurrency:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15+
env:
16+
VERSION_SUFFIX: "PR-${{ github.event.number }}"
1517
steps:
1618
- uses: actions/checkout@v4
1719
- name: Check Path Filter
@@ -31,10 +33,20 @@ jobs:
3133
- name: Build
3234
if: steps.filter.outputs.code == 'true'
3335
run: ./gradlew assemble --build-cache
34-
- name: Upload Artifact
36+
- name: Rename Jars
37+
if: steps.filter.outputs.code == 'true'
38+
run: for file in build/libs/*; do mv "$file" "${file/.jar/-${{ env.VERSION_SUFFIX }}.jar}"; done;
39+
- name: Upload All Artifacts
3540
if: steps.filter.outputs.code == 'true'
3641
uses: actions/upload-artifact@v4.0.0
3742
with:
38-
name: build output
43+
name: Full Package
3944
path: build/libs/*
4045
retention-days: 15
46+
- name: Upload Main Jar
47+
if: steps.filter.outputs.code == 'true'
48+
uses: actions/upload-artifact@v4.0.0
49+
with:
50+
name: Main Jar
51+
path: build/libs/*[0-9]-PR-*.jar
52+
retention-days: 15

.github/workflows/deploy-pages.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish docs via GitHub Pages
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: [1.20.1]
6+
paths: ['docs/**']
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
name: build docs
20+
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
working-directory: './docs'
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: '1.20.1'
28+
sparse-checkout: './docs'
29+
- uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.11'
32+
cache: 'pip'
33+
- run: pip install -r ./requirements.txt
34+
- uses: actions/cache@v4
35+
with:
36+
key: 'mkdocs-cache'
37+
path: './docs/.cache'
38+
- name: Build static files
39+
id: mkdocs
40+
run: mkdocs build
41+
- name: Upload pages as artifact
42+
id: artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: './docs/site/'
46+
47+
deploy:
48+
runs-on: ubuntu-latest
49+
needs: build
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
- name: Deploy Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.github/workflows/manage-pr-labels.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ name: Pull Request Labels
33

44
# Checks for label once PR has been reviewed or label is applied
55
on:
6-
pull_request_review:
7-
types: [submitted]
86
pull_request:
9-
types: [labeled]
7+
types: [opened, labeled, unlabeled]
108

119
concurrency:
1210
group: pr-labels-${{ github.head_ref }}
1311
cancel-in-progress: true
1412

1513
jobs:
16-
Labels:
17-
name: On Approval
18-
if: github.event.review.state == 'approved'
14+
labels:
15+
name: Label Check
1916
runs-on: ubuntu-latest
2017
permissions:
2118
pull-requests: read # needed to utilize required-labels

0 commit comments

Comments
 (0)