-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.58 KB
/
Copy pathpublish-gradle-plugin.yml
File metadata and controls
50 lines (41 loc) · 1.58 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
name: Publish Gradle Plugin
on:
push:
tags: ['plugin-v*']
workflow_dispatch:
jobs:
gradle-plugin-portal:
name: Publish to Gradle Plugin Portal
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Make gradlew executable
run: chmod +x gradlew
- name: Extract version from tag
id: version
run: |
if [[ "$GITHUB_REF" == refs/tags/plugin-v* ]]; then
echo "VERSION=${GITHUB_REF_NAME#plugin-v}" >> $GITHUB_OUTPUT
fi
- name: Build
run: ./gradlew :python-embed-gradle-plugin:build${{ steps.version.outputs.VERSION && format(' -PreleaseVersion={0}', steps.version.outputs.VERSION) || '' }}
- name: Publish to Gradle Plugin Portal
run: ./gradlew :python-embed-gradle-plugin:publishPlugins --no-configuration-cache${{ steps.version.outputs.VERSION && format(' -PreleaseVersion={0}', steps.version.outputs.VERSION) || '' }}
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- name: Create GitHub Release
if: steps.version.outputs.VERSION != ''
uses: softprops/action-gh-release@v3
with:
name: "python-embed-gradle-plugin v${{ steps.version.outputs.VERSION }}"
generate_release_notes: true