Skip to content

Commit 088541b

Browse files
committed
github release workflow
1 parent b7c5e0a commit 088541b

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/release-tags.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Release tagged build
5+
6+
on:
7+
push:
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set release version
20+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
21+
22+
- name: Set up JDK 8
23+
uses: actions/setup-java@v2
24+
with:
25+
java-version: '8'
26+
distribution: 'adopt'
27+
cache: gradle
28+
29+
- name: Grant execute permission for gradlew
30+
run: chmod +x gradlew
31+
32+
- name: Setup the workspace
33+
run: ./gradlew setupCIWorkspace
34+
35+
- name: Publish to Maven, Modrinth, and CurseForge
36+
run: ./gradlew publish
37+
env:
38+
MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }}
39+
MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }}
40+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
41+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
42+
43+
- name: Release under current tag
44+
uses: "marvinpinto/action-automatic-releases@latest"
45+
with:
46+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
47+
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
48+
prerelease: false
49+
title: "${{ env.RELEASE_VERSION }}"
50+
files: build/libs/*.jar

0 commit comments

Comments
 (0)