Fix actions workflow (pt1?)

This commit is contained in:
Jason Penilla committed 2023-04-15 09:55:10 -07:00
1 parent c518968361
commit f5aedd7016
2 files changed
+20 -20

No files matched your search

+19 -19
View File
@@ -10,7 +10,7 @@ on:
jobs: jobs:
build: build:
# Only run on PRs if the source branch is on someone else's repo # 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 runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@@ -35,38 +35,38 @@ jobs:
restore-keys: ${{ runner.os }}-gradle- restore-keys: ${{ runner.os }}-gradle-
- name: Build - name: Build
run: ./gradlew build --stacktrace run: ./gradlew build --stacktrace
- name: Determine Release Status - name: Determine Snapshot Status
run: | run: |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
echo "STATUS=snapshot" >> $GITHUB_ENV echo "STATUS=snapshot" >> $GITHUB_ENV
else else
echo "STATUS=release" >> $GITHUB_ENV echo "STATUS=release" >> $GITHUB_ENV
fi fi
- name: Publish Snapshot # - name: Publish Snapshot to Maven
if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/rewrite' }}" # if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/2.1' }}"
run: ./gradlew publish --stacktrace # run: ./gradlew publish --stacktrace
env: # env:
ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}" # ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}" # ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
- name: Publish Release # - name: Publish (Pre-)Release to Maven
if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}" # if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
run: ./gradlew publish --stacktrace # run: ./gradlew publish --stacktrace
env: # env:
ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}" # ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}" # ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
- name: Parse tag - 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 id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Create release and changelog - name: Create Pre-Release and changelog
if: "${{ github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.') }}" if: "${{ github.event_name == 'push' && contains(github.ref, '+beta.') }}"
uses: MC-Machinations/[email protected] uses: MC-Machinations/[email protected]
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
title: CarbonChat ${{ steps.vars.outputs.tag }} title: CarbonChat ${{ steps.vars.outputs.tag }}
pre-release: true pre-release: true
- name: "Publish Release to Hangar" - name: Publish (Pre-)Release to Hangar
if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.event.push.base_ref, '+beta.'))) }}" if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '+beta.'))) }}"
run: ./gradlew publishAllPublicationsToHangar run: ./gradlew publishAllPublicationsToHangar
env: env:
HANGAR_UPLOAD_KEY: "${{ secrets.HANGAR_UPLOAD_KEY }}" HANGAR_UPLOAD_KEY: "${{ secrets.HANGAR_UPLOAD_KEY }}"
+1 -1
View File
@@ -1,5 +1,5 @@
# Project Properties # Project Properties
projectVersion=2.1.0-SNAPSHOT+beta.3 projectVersion=2.1.0+beta.3
# Gradle Properties # Gradle Properties
org.gradle.configureondemand=true org.gradle.configureondemand=true