Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak workflow #4

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
name: Java Package Publishing

on:
workflow_dispatch:
inputs:
version:
description: 'Enter the new version for the package'
required: true

jobs:
build:
name: Build Reseller API
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17']
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
java-version: '11'
distribution: 'temurin'
cache: maven

Expand All @@ -31,14 +35,16 @@ jobs:
if git diff --exit-code; then
echo "No changes to commit."
else
git add .
git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push https://${{secrets.WORKFLOW_TOKEN}}@github.com/ingrammicro-xvantage/xi-sdk-resellers-java main
git push
fi

- name: Build with Maven
run: mvn -B package --no-transfer-progress --file pom.xml

- name: Publish Package
run: mvn --batch-mode clean deploy
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN}}
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
Loading