-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (79 loc) · 3.19 KB
/
Copy pathrelease.yml
File metadata and controls
96 lines (79 loc) · 3.19 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Pano Plugin Build
on:
push:
branches: ['dev', 'main']
permissions:
contents: read
jobs:
get-next-version:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Dry run to get next release version
id: get-next-version
run: |
npm install -D git+https://github.com/PanoMC/semantic-release-pano.git
export NEXT_TAG_VERSION=$(npx semantic-release --dry-run | grep 'next release version is ' | awk -F"next release version is " '{print $2}')
echo "new_tag_version=${NEXT_TAG_VERSION}" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
PANO_TOKEN: ${{ secrets.PANO_TOKEN }}
PANO_PROD_TOKEN: ${{ secrets.PANO_PROD_TOKEN }}
- name: Echo new_tag_version
run: |
echo "Extracted Tag Version: ${{ steps.get-next-version.outputs.new_tag_version }}"
outputs:
new_tag_version: ${{ steps.get-next-version.outputs.new_tag_version }}
build-and-release:
runs-on: ubuntu-latest
needs: get-next-version
if: ${{needs.get-next-version.outputs.new_tag_version != ''}}
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 'latest'
- name: Install
run: bun install
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build
run: |
./gradlew build \
-Pversion=${{ needs.get-next-version.outputs.new_tag_version }} \
-PtimeStamp=${{ steps.time.outputs.time }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
PANO_TOKEN: ${{ secrets.PANO_TOKEN }}
PANO_PROD_TOKEN: ${{ secrets.PANO_PROD_TOKEN }}
run: |
npm install -D git+https://github.com/PanoMC/semantic-release-pano.git
npx semantic-release