Skip to content

Commit

Permalink
add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
avan1235 committed Oct 21, 2023
1 parent b4cf424 commit 4e9c344
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
push:
tags:
- "v*.*.*"


jobs:
release:
name: Create release
runs-on: macos-latest
permissions: write-all
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Extract version name
id: extract_name
run: echo "name=$(echo ${GITHUB_REF##*/})" >>$GITHUB_OUTPUT
shell: bash

- name: Checkout to push branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
name: Release ${{ steps.extract_name.outputs.name }}
body: ${{ steps.changelog.outputs.changelog }}

publish:
name: Publish release
permissions: write-all
runs-on: macos-latest
needs: release
steps:
- name: Checkout to push branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Extract version from tag
uses: damienaicheh/[email protected]

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'corretto'

- name: Publish to MavenCentral
run: ./gradlew publishAllPublicationsToSonatypeRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

0 comments on commit 4e9c344

Please sign in to comment.