Skip to content

Commit

Permalink
Update CI to publish a release on tag (#25)
Browse files Browse the repository at this point in the history
Co-authored-by: Drew Heavner <[email protected]>
  • Loading branch information
r0adkll and Drew Heavner authored Aug 22, 2024
1 parent 3a6b6bb commit df178b9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,43 @@ jobs:

- name: Publish snapshot (main branch only)
run: ./gradlew publish -PmavenCentralUsername=${{ secrets.SONATYPEUSERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPEPASSWORD }} --no-configuration-cache

publish-release:
runs-on: macos-latest
timeout-minutes: 60
needs: [ build ]
if: github.repository == 'r0adkll/kimchi' && contains(github.ref, 'refs/tags/')

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Publish Release
run: |
./gradlew publish \
-DVERSION_NAME=${{ github.ref_name }}
-PmavenCentralUsername=${{ secrets.SONATYPEUSERNAME }} \
-PmavenCentralPassword=${{ secrets.SONATYPEPASSWORD }} \
--no-configuration-cache
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} \
--title ${{ github.ref_name }} \
--notes '${{ steps.extract-release-notes.outputs.release_notes }}'
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ TODO: Use https://github.com/ffurrer2/extract-release-notes when crafting a rele
### Added

- Migrated implementation from Deckbox and Campfire
- Initial Release

0 comments on commit df178b9

Please sign in to comment.