Skip to content

Commit

Permalink
ci: Change how version is being checked
Browse files Browse the repository at this point in the history
  • Loading branch information
IanTapply22 committed May 25, 2024
1 parent 17c550f commit 7d74389
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,12 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Compare with published version
id: compare_versions
run: |
PUBLISHED_VERSION=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/IanTapply22/packages/maven/wynncraft/versions | jq '[.[] ] | .[0] .metadata .container .tags[0]')
if [[ "$PUBLISHED_VERSION" == *"${{needs.version.outputs.version}}"* ]]; then
echo "Version is already published. Skipping publish step."
echo "::set-output name=skip::true"
else
echo "Version not published. Proceeding with publish step."
echo "::set-output name=skip::false"
fi
- name: Check version changes
id: check
uses: EndBug/version-check@v1.0.0 # More info about the arguments on the action page

- name: Publish package
if: steps.compare_versions.outputs.skip != 'true'
if: steps.check.outputs.changed == 'true'
run: ./gradlew publish
env:
GITHUB_USERNAME: IanTapply22
Expand Down

0 comments on commit 7d74389

Please sign in to comment.