Repository navigation
60 lines (56 loc) · 2.11 KB
/
Copy pathpublish.yml
File metadata and controls
60 lines (56 loc) · 2.11 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
# A workflow for publishing the plugin to the Gradle Plugin Portal
#
# Release Process:
# 1. Pre-release:
# 1. Update the version number in root build.gradle to the next non-SNAPSHOT version.
# e.g. replace `version '1.2.3-SNAPSHOT' with '1.2.3'
# 2. Replace all references to the last release number with the new release number.
# e.g. search for `1.2.2` and replace with `1.2.3`.
# 3. Commit changes in PR and merge.
# 2. Release
# 1. Checkout the main branch and pull the latest changes.
# 2. Create and push the release version tag.
# e.g. `git tag v1.2.3 && git push origin v1.2.3`
# Pushing the tag triggers this workflow, which publishes the plugin
# and creates the GitHub Release.
# 3. Ensure the publishing run passes
# 3. Post-release:
# 1. Update the version number in root build.gradle to the next -SNAPSHOT version.
# e.g. replace `version '1.2.3' with '1.2.4-SNAPSHOT'
# 2. Add the new release to the Compatibility Matrix in the README.md file.
# 3. Commit changes in PR and merge.
name: Publish to the Gradle Plugin Portal
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
steps:
- name: Git checkout
uses: actions/checkout@v7.0.1
- name: Set up JDK 17
uses: actions/setup-java@v6.0.1
with:
cache: gradle
distribution: microsoft
java-version: 17
- name: Create gradle.properties
run: echo -e "gradle.publish.key=$GRADLE_PUBLISH_KEY\ngradle.publish.secret=$GRADLE_PUBLISH_SECRET" > gradle.properties
- name: Build with Gradle
run: ./gradlew build -x test publishPlugins
create-gh-release:
needs: [publish]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v3.0.0
- name: Create GitHut Release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v0.1.15
with:
generate_release_notes: true