Skip to content

Commit

Permalink
Add publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
clrxbl committed Feb 27, 2024
1 parent 712cc98 commit fe03fc9
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Build

on:
push:
branches:
- "**"
workflow_dispatch:
push:
branches: [ "**" ]
tags-ignore: [ "**" ]
pull_request:
release:
types: [ published ]
workflow_dispatch:

jobs:
build:
Expand All @@ -28,7 +31,18 @@ jobs:
- name: Gradle Build
run: ./gradlew build

- uses: actions/upload-artifact@v3
with:
name: interfaces-artifacts
path: "**/build/libs/*.jar"
- name: Determine 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/main' }}"
run: ./gradlew publish

- name: Publish Release
if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
run: ./gradlew publish

0 comments on commit fe03fc9

Please sign in to comment.