Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Aug 27, 2024
1 parent 213023b commit d7248e0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- '**'

jobs:
release:
runs-on: ubuntu-latest
if: github.repository_owner == 'melix'
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
# Disable CC due to https://github.com/gradle/gradle/issues/22779
- run: ./gradlew publish publishPlugins --no-configuration-cache
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_SECRET }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}
- name: Create release
run: |
# Extract version from tag, e.g. RELEASE_1_2_3 -> 1.2.3
version=$(echo ${{ github.ref_name }} | sed -E 's/RELEASE_([0-9]+)_([0-9]+)_([0-9]+)/\1.\2.\3/')
echo "$version"
gh release create ${{ github.ref_name }} --title "$version" --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d7248e0

Please sign in to comment.