Setup auto hangar publishing

This commit is contained in:
Jason Penilla committed 2023-04-13 18:12:33 -07:00
1 parent 2f3a2a66f7
commit 4c60d0f472
4 files changed
+54 -2

No files matched your search

+19 -2
View File
@@ -2,7 +2,7 @@ name: Build
on:
push:
branches: [ "**" ]
tags-ignore: [ "**" ]
tags: [ "v**" ]
pull_request:
release:
types: [ released ]
@@ -10,7 +10,7 @@ on:
jobs:
build:
# Only run on PRs if the source branch is on someone else's repo
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
if: ${{ (github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name) && (github.event.name != 'push' || !startsWith(github.event.push.base_ref, 'refs/tags/') || contains(github.event.push.base_ref, '+beta.')) }}
runs-on: ubuntu-latest
strategy:
matrix:
@@ -54,6 +54,23 @@ jobs:
env:
ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
- name: Parse tag
if: "${{ github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.') }}"
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Create release and changelog
if: "${{ github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.') }}"
uses: MC-Machinations/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: CarbonChat ${{ steps.vars.outputs.tag }}
pre-release: true
- name: "Publish Release to Hangar"
if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.'))) }}"
run: ./gradlew publishAllPublicationsToHangar
env:
HANGAR_UPLOAD_KEY: "${{ secrets.HANGAR_UPLOAD_KEY }}"
RELEASE_NOTES: "${{ github.event.release.body }}"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with: