Skip to content

Commit 370640a

Browse files
committed
feat(ci): update CI workflows for release process and branch handling
1 parent f030931 commit 370640a

3 files changed

Lines changed: 58 additions & 21 deletions

File tree

.github/workflows/build-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
distribution: temurin
2020
java-version: 21
2121
- name: Build on ${{ matrix.os }}
22-
run: ./gradlew clean build -x test
22+
run: ./gradlew clean build

.github/workflows/close_invalid_prs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66

77
jobs:
88
run:
9-
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'develop' }}
9+
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'main' }}
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: superbrothers/close-pull-request@v3
1313
with:
14-
comment: "Please do not open pull requests from the `develop` branch, create a new branch instead."
14+
comment: "Please do not open pull requests from the `main` branch, create a new branch instead."

.github/workflows/publish.yml

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,67 @@
1-
name: Publish Attollo to platforms
2-
on:
1+
name: Release
2+
"on":
33
push:
44
branches:
5-
- master
6-
- develop
5+
- main
6+
- next
7+
- beta
8+
- alpha
9+
- "*.x"
10+
11+
permissions:
12+
contents: read # for checkout
13+
714
jobs:
8-
Publish:
9-
name: 'Publish to EldoNexus, Modrinth and Hangar'
10-
# Run on all label events (won't be duplicated) or all push events or on PR syncs not from the same repo
11-
if: github.repository_owner == 'OneLiteFeatherNET'
15+
release:
16+
name: Release
1217
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write # to be able to publish a GitHub release
20+
issues: write # to be able to comment on released issues
21+
pull-requests: write # to be able to comment on released pull requests
22+
id-token: write # to enable use of OIDC for npm provenance
1323
steps:
14-
- name: Checkout Repository
24+
- name: Checkout
1525
uses: actions/checkout@v5
16-
- name: Setup Gradle
17-
uses: gradle/actions/setup-gradle@v4
26+
with:
27+
fetch-depth: 0
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v6
30+
with:
31+
node-version: "lts/*"
32+
- name: Validate Gradle Wrapper
33+
uses: gradle/actions/wrapper-validation@v5
1834
- name: Setup Java
19-
uses: actions/setup-java@v4
35+
uses: actions/setup-java@v5
2036
with:
2137
distribution: temurin
22-
cache: gradle
23-
java-version: 17
24-
- name: Publish to Jar
25-
run: ./gradlew build publishAllPublicationsToHangar modrinth publish -x test
38+
java-version: 24
39+
- name: Setup Gradle
40+
uses: gradle/actions/setup-gradle@v5
41+
- name: Install dependencies
42+
run: npm clean-install
43+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
44+
run: npm audit signatures
45+
- name: Release
2646
env:
27-
ELDO_USERNAME: "${{ secrets.ELDO_USERNAME }}"
28-
ELDO_PASSWORD: "${{ secrets.ELDO_PASSWORD }}"
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2949
HANGAR_SECRET: ${{secrets.HANGAR_KEY}}
3050
MODRINTH_TOKEN: ${{ secrets.MODRINTH_KEY }}
51+
# Token with permissions to push to the client repository
52+
CLIENT_REPO_TOKEN: ${{ secrets.CLIENT_REPO_TOKEN }}
53+
run: npx semantic-release
54+
- name: Get Version
55+
id: get_version
56+
run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_ENV
57+
- name: Upload BOM to Dependency-Track
58+
uses: DependencyTrack/gh-upload-sbom@v3
59+
with:
60+
serverhostname: ${{ secrets.DEPENDENCYTRACK_HOSTNAME }}
61+
apikey: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
62+
projectname: "Attollo"
63+
projectversion: ${{ env.VERSION }}
64+
projecttags: 'bukkit,paper,plugin'
65+
bomfilename: "build/reports/cyclonedx/bom.xml"
66+
autocreate: true
67+
parent: 'becbe738-ef2b-4333-bd13-477ab794d76a'

0 commit comments

Comments
 (0)