diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml new file mode 100644 index 00000000..df5e14b5 --- /dev/null +++ b/.github/workflows/new-release.yml @@ -0,0 +1,70 @@ +name: New Release Workflow + +on: + + release: + types: [ released ] + +jobs: + + publish_prod_packages: + + name: Publish Snapshot Packages + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: 'master' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Update to snapshot version + env: + VERSION: ${{ github.ref_name }} + run: | + echo "Updating to version: ${VERSION}" + mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${VERSION} + mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=${VERSION} + + - name: Publish package + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish_snapshot_packages: + + name: Publish Snapshot Packages + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: 'develop' + + - name: Setup Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Update to snapshot version + env: + SNAPSHOT_VERSION: ${{ github.ref_name }}-SNAPSHOT + run: | + echo "Updating to version: ${SNAPSHOT_VERSION}" + mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${SNAPSHOT_VERSION} + mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=${SNAPSHOT_VERSION} + + - name: Publish package + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml deleted file mode 100644 index 09225ae3..00000000 --- a/.github/workflows/release-publish.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Publish packages to GitHub Packages - -on: - release: - types: [ released ] - push: - branches: - - 'release-publish' - - -jobs: - update_version: - runs-on: ubuntu-latest - - steps: - - - name: Checkout the code - uses: actions/checkout@v3 - - - name: Update POM Version - run: | - echo "Updating to version: $(jq -r '.pull_request.milestone.title' $GITHUB_EVENT_PATH)" - mvn versions:set -DnewVersion=$(jq -r '.pull_request.milestone.title' $GITHUB_EVENT_PATH) - mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=$(jq -r '.pull_request.milestone.title' $GITHUB_EVENT_PATH) - - - name: Diff check - run: git diff - - - name: Add & Commit - uses: EndBug/add-and-commit@v9.1.1 - with: - add: '.' - default_author: github_actions - push: origin HEAD:develop --force - - publish_packages: - needs: [update_version] - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - - name: Checkout the code - uses: actions/checkout@v3 - with: - ref: 'master' - - - name: Setup JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - - - name: Publish package - run: mvn --batch-mode deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file