-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (58 loc) · 2.09 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (58 loc) · 2.09 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: false
jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
steps:
- name: Assign input version
if: github.event.inputs.version != null
run: echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
if: github.event.inputs.version == null
id: candidate-version
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const list = await github.rest.repos.listReleases({
owner: "domaframework",
repo: "doma-compile-plugin",
});
console.log(list)
let version = list.data[0].name
return version.startsWith("v") ? version.substring(1) : version
- name: Assign candidate version
if: github.event.inputs.version == null
run: echo "RELEASE_VERSION=${{ steps.candidate-version.outputs.result }}" >> $GITHUB_ENV
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: 'zulu'
java-version: 21
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
- name: Release ${{ env.RELEASE_VERSION }}
run: |
java -version
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
./gradlew release -Prelease.releaseVersion=${{ env.RELEASE_VERSION }}
- name: Upload reports
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: build
path: ./**/build/reports