Skip to content

Commit

Permalink
Fix actions workflow (pt1?)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Apr 15, 2023
1 parent c518968 commit f5aedd7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) && (github.event.name != 'push' || !startsWith(github.event.push.base_ref, 'refs/tags/') || contains(github.event.push.base_ref, '+beta.')) }}
if: ${{ (github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name) && (github.event.name != 'push' || !startsWith(github.ref, 'refs/tags/') || contains(github.ref, '+beta.')) }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -35,38 +35,38 @@ jobs:
restore-keys: ${{ runner.os }}-gradle-
- name: Build
run: ./gradlew build --stacktrace
- name: Determine Release Status
- name: Determine Snapshot Status
run: |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
echo "STATUS=snapshot" >> $GITHUB_ENV
else
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: Publish Snapshot
if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/rewrite' }}"
run: ./gradlew publish --stacktrace
env:
ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
- name: Publish Release
if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
run: ./gradlew publish --stacktrace
env:
ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
# - name: Publish Snapshot to Maven
# if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/2.1' }}"
# run: ./gradlew publish --stacktrace
# env:
# ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
# ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
# - name: Publish (Pre-)Release to Maven
# if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
# run: ./gradlew publish --stacktrace
# 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.') }}"
if: "${{ github.event_name == 'push' && contains(github.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.') }}"
- name: Create Pre-Release and changelog
if: "${{ github.event_name == 'push' && contains(github.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.'))) }}"
- name: Publish (Pre-)Release to Hangar
if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '+beta.'))) }}"
run: ./gradlew publishAllPublicationsToHangar
env:
HANGAR_UPLOAD_KEY: "${{ secrets.HANGAR_UPLOAD_KEY }}"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project Properties
projectVersion=2.1.0-SNAPSHOT+beta.3
projectVersion=2.1.0+beta.3

# Gradle Properties
org.gradle.configureondemand=true
Expand Down

0 comments on commit f5aedd7

Please sign in to comment.