Skip to content

Commit 4029408

Browse files
committed
add publish
1 parent fffe3d7 commit 4029408

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "publish"
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
- "master"
8+
paths:
9+
- src/**
10+
- build.gradle
11+
- gradle.properties
12+
- settings.gradle
13+
workflow_dispatch:
14+
15+
env:
16+
RELEASE_TITLE: "Starlight 1.16.1 - build ${{github.run_number}}"
17+
RELEASE_TAG: "v${{github.run_number}}"
18+
RELEASE_FILE: "build/libs/*-v${{github.run_number}}.jar"
19+
20+
jobs:
21+
publish:
22+
runs-on: "ubuntu-latest"
23+
steps:
24+
- name: Checkout sources
25+
uses: actions/checkout@v2
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v3
28+
with:
29+
java-version: '17'
30+
distribution: 'adopt'
31+
- name: Build artifacts
32+
run: ./gradlew build
33+
- name: Publish tagged version
34+
uses: "marvinpinto/action-automatic-releases@latest"
35+
with:
36+
automatic_release_tag: "${{ env.RELEASE_TAG }}"
37+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
38+
prerelease: false
39+
title: ${{ env.RELEASE_TITLE }}
40+
files: |
41+
LICENSE*
42+
${{ env.RELEASE_FILE }}
43+
- name: Publish latest
44+
uses: "marvinpinto/action-automatic-releases@latest"
45+
with:
46+
automatic_release_tag: "latest"
47+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
48+
prerelease: false
49+
title: ${{ env.RELEASE_TITLE }}
50+
files: |
51+
LICENSE*
52+
${{ env.RELEASE_FILE }}

0 commit comments

Comments
 (0)