mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Fix actions workflow (pt1?)
This commit is contained in:
2 files changed
+20
-20
No files matched your search
+19
-19
@@ -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:
|
||||
@@ -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 }}"
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user