-
Notifications
You must be signed in to change notification settings - Fork 12
59 lines (51 loc) · 1.61 KB
/
publish-snapshot.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
52
53
54
55
56
57
58
59
name: Publish SNAPSHOT
on:
workflow_dispatch:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache
uses: actions/cache@v4
with:
path: |
**/node_modules
~/.gradle/caches
~/.gradle/wrapper
key: 11-node-${{ hashFiles('**/package-lock.json') }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: 11-
- name: Get SNAPSHOT version ids
uses: castlabs/[email protected]
id: version
with:
version: "99-SNAPSHOT"
- name: Delete SNAPSHOT versions
uses: actions/[email protected]
if: ${{ steps.version.outputs.ids != '' }}
with:
package-version-ids: "${{ steps.version.outputs.ids }}"
- name: Publish artifacts
run: ./gradlew clean server:publish server-api:publish types:publish -x test
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "server/build/distributions/onCourseServer-*"
allowUpdates: true
generateReleaseNotes: true
commit: main
tag: '99-SNAPSHOT'
token: ${{ secrets.GITHUB_TOKEN }}