Skip to content

Commit 70319f4

Browse files
authored
[ci skip] Create publish-release.yml
1 parent 926cdc7 commit 70319f4

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/publish-release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish Releases
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
8+
jobs:
9+
build:
10+
name: Build artifacts job
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
- name: Validate Gradle Wrapper
16+
uses: gradle/wrapper-validation-action@v1
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'temurin'
21+
java-version: 17
22+
- name: Change wrapper permissions
23+
run: chmod +x ./gradlew
24+
- name: Cache Gradle dependencies
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.gradle/caches
28+
key: ${{ runner.OS }}-gradle-${{ hashFiles('**/*.gradle') }}
29+
restore-keys: |
30+
${{ runner.OS }}-gradle-
31+
- name: Build artifacts
32+
env:
33+
REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }}
34+
REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }}
35+
run: ./gradlew build
36+
- name: Publish to SayanDevelopment snapshot repo
37+
run: ./gradlew publish
38+
env:
39+
REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }}
40+
REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }}
41+
- name: Publish to Hangar
42+
env:
43+
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }}
44+
HANGAR_BUILD_CHANNEL: Release
45+
HANGAR_CHANGELOG: ${{ github.event.release.body }}
46+
REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }}
47+
REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }}
48+
run: ./gradlew build publishPluginPublicationToHangar --stacktrace
49+
- name: Publish to Modrinth
50+
run: ./gradlew modrinth
51+
env:
52+
MODRINTH_BUILD_CHANNEL: release
53+
MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_API_TOKEN }}
54+
MODRINTH_CHANGELOG: ${{ github.event.release.body }}
55+
REPO_SAYAN_USER: ${{ secrets.REPO_SAYAN_USER }}
56+
REPO_SAYAN_TOKEN: ${{ secrets.REPO_SAYAN_TOKEN }}
57+

0 commit comments

Comments
 (0)