-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (46 loc) · 1.44 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Publish
on:
push:
branches: [ "main" ]
permissions:
contents: read
statuses: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: neoforged/action-tag-versioning@v1
name: Calculate version
id: version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
labels: -beta, -stable
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1000
fetch-tags: true
- name: Make Gradlew executable
# language=bash
run: chmod +x ./gradlew # Thanks Windows
- name: Setup Java 17
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#java
# language=bash
run: |
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> "$GITHUB_ENV"
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- uses: neoforged/action-github-status@v1
name: Set pending status
with:
authToken: ${{secrets.GITHUB_TOKEN}}
context: 'Publishing'
state: 'success'
description: "Version: ${{ steps.version.outputs.version }}"
target_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}