-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (65 loc) · 2.29 KB
/
release.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Release
on:
push:
tags:
- "v*"
env:
CI: true
BUILD_NUMBER: ${{ github.run_number }}
SCM_TAG: ${{ github.sha }}
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4a1e83c9ef6b0e39b16f17b2734e08cdfbeea46c
with:
disable-sudo: true
egress-policy: audit
- name: Checkout
uses: actions/checkout@v3
- name: Prepare release settings
run: |
echo "GITHUB_REF_NAME: $GITHUB_REF_NAME"
RELEASE_PRE=false
RELEASE_SUFFIX=""
# Check release type
if [[ $GITHUB_REF_NAME =~ 'alpha' || $GITHUB_REF_NAME =~ 'beta' || $GITHUB_REF_NAME =~ 'rc' ]]; then
echo "This is a pre-release!"
RELEASE_PRE=true
RELEASE_SUFFIX=" (pre release)"
fi
echo "RELEASE_PRE=$RELEASE_PRE" >> $GITHUB_ENV
echo "RELEASE_SUFFIX=$RELEASE_SUFFIX" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
cache-read-only: true
- name: Check and publish plugin
if: github.repository == 'fluxo-kt/fluxo-bcv-js'
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
RELEASE: true
run: ./gradlew build assemble check publishPlugins --no-build-cache --stacktrace --scan
-Pgradle.publish.key="${{ secrets.GRADLE_PUBLISH_KEY }}"
-Pgradle.publish.secret="${{ secrets.GRADLE_PUBLISH_SECRET }}"
continue-on-error: true
- name: GitHub Release
# https://github.com/anton-yurchenko/git-release#readme
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "true"
PRE_RELEASE: "${{ env.RELEASE_PRE }}"
RELEASE_NAME_SUFFIX: "${{ env.RELEASE_SUFFIX }}"
CHANGELOG_FILE: "CHANGELOG.md"
ALLOW_EMPTY_CHANGELOG: "false"
# References
# https://github.com/studiometa/vue-mapbox-gl/blob/8c3ca5a/.github/workflows/release.yml#L26