-
Notifications
You must be signed in to change notification settings - Fork 84
Feature/376 add deployment action #377
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ccbfe54
Upgrade plugin versions
kevinwallimann 3e3ab50
Add skeleton release and deploy actions
kevinwallimann b0faa4d
Add release and deploy actions
kevinwallimann 99652fa
Fix version
kevinwallimann fa472bb
Fix release notes title
kevinwallimann 4fc040d
Remove dry-run
kevinwallimann 8535ae8
Fix PR comments
kevinwallimann 998719e
Add explicit job permissions
kevinwallimann 7460aab
Add explicit job permissions
kevinwallimann 8237027
Update secret names
kevinwallimann df5bca1
Fix actions
kevinwallimann 320f74c
skip actual deploy for testing
kevinwallimann 614d13e
Rename environmnet, activate deploy workflow
kevinwallimann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| name: Create a new release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag-name: | ||
| description: 'New tag for release. Example: v0.5.2' | ||
| required: true | ||
| from-tag-name: | ||
| description: 'Previous tag to compare for release notes generation. Example: v0.5.1 Default value: latest tag.' | ||
| required: false | ||
|
|
||
| jobs: | ||
| create-release: | ||
| permissions: | ||
| contents: write | ||
| pull-requests: read | ||
| issues: read | ||
| runs-on: ubuntu-latest | ||
| environment: publish | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 0 # Fetch all history for all tags and branches | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.14' | ||
|
|
||
| - name: Check format of received tag | ||
| id: check-version-tag | ||
| uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 # v1.0.0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| github-repository: ${{ github.repository }} | ||
| version-tag: ${{ github.event.inputs.tag-name }} | ||
|
|
||
| - name: Check format of received from tag | ||
| if: ${{ github.event.inputs.from-tag-name }} | ||
| id: check-version-from-tag | ||
| uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 # v1.0.0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| github-repository: ${{ github.repository }} | ||
| version-tag: ${{ github.event.inputs.from-tag-name }} | ||
| should-exist: true | ||
|
|
||
| - name: Define semantic version number | ||
| id: semantic_version | ||
| run: | | ||
| TAG_NAME="${{ github.event.inputs.tag-name }}" | ||
| VERSION=${TAG_NAME#v} | ||
| echo "VERSION=${VERSION}" >> "${GITHUB_ENV}" | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config --global user.name "${{ github.actor }}" | ||
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v6 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: 17 | ||
|
|
||
| - name: Set Maven project version, create tag | ||
| run: | | ||
| mvn versions:set -DnewVersion=${VERSION} --no-transfer-progress | ||
| mvn versions:commit | ||
| git commit -am "Set project version to ${VERSION}" | ||
| git push | ||
|
|
||
| - name: Create tag | ||
| run: | | ||
| git tag ${{ github.event.inputs.tag-name }} | ||
| git push origin ${{ github.event.inputs.tag-name }} | ||
|
|
||
| - name: Set next development version | ||
| run: | | ||
| # Assumes semantic versioning and increments the minor version. Adjust the awk command as needed for different versioning schemes. | ||
| NEXT_VERSION=$(echo ${VERSION} | awk -F. '{print $1"."$2+1".0-SNAPSHOT"}') | ||
| mvn versions:set -DnewVersion=$NEXT_VERSION --no-transfer-progress | ||
| mvn versions:commit | ||
| git commit -am "Set project version to $NEXT_VERSION" | ||
| git push | ||
|
|
||
| - name: Generate Release Notes | ||
| id: generate_release_notes | ||
| uses: AbsaOSS/generate-release-notes@b4d6e3fafcff2dedc32ec751975fa3d0b3efad67 # v1.3.1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag-name: ${{ github.event.inputs.tag-name }} | ||
| from-tag-name: ${{ github.event.inputs.from-tag-name }} | ||
| hierarchy: true | ||
| chapters: | | ||
| - { title: Breaking Changes 💥, labels: breaking-change } | ||
| - { title: New Features 🎉, labels: enhancement } | ||
| - { title: Bugfixes 🛠, labels: [bug, bugfix] } | ||
| - { title: Other Changes, labels: [improvement, internal, chore] } | ||
| - { title: Silent Live 🤫, catch-open-hierarchy: true} | ||
| warnings: true | ||
| print-empty-chapters: false | ||
|
|
||
| - name: Create Draft Release | ||
| uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| name: ABRiS ${{ env.VERSION}} | ||
| body: ${{ steps.generate_release_notes.outputs.release-notes }} | ||
| tag_name: ${{ github.event.inputs.tag-name }} | ||
| draft: true | ||
| prerelease: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # | ||
| # Copyright 2018 ABSA Group Limited | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| name: Deploy | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| deploy: | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| issues: read | ||
| runs-on: ubuntu-latest | ||
| environment: publish | ||
| steps: | ||
| - name: Validate ref is a tag | ||
| if: github.ref_type != 'tag' | ||
| run: | | ||
| echo "This workflow must run from a tag." | ||
| exit 1 | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 0 # Fetch all history for all tags and branches | ||
|
|
||
| - name: Check format of received tag | ||
| id: check-version-tag | ||
| uses: AbsaOSS/version-tag-check@4145e48bf3f77a5afff2ec9afdd8afb6b53bce34 # v1.0.0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| github-repository: ${{ github.repository }} | ||
| version-tag: ${{ github.ref_name }} | ||
| should-exist: 'true' | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v6 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: 17 | ||
|
|
||
| - name: Import GPG keys | ||
| run: | | ||
| echo "${{ secrets.PGP_SECRET }}" | base64 --decode | gpg --batch --import | ||
|
|
||
| - name: Create settings.xml | ||
| run: | | ||
| echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd\"> | ||
| <servers> | ||
| <server> | ||
| <id>central</id> | ||
| <username>${{ secrets.SONATYPE_USERNAME }}</username> | ||
| <password>${{ secrets.SONATYPE_PASSWORD }}</password> | ||
| </server> | ||
| </servers> | ||
| </settings>" > $HOME/.m2/settings.xml | ||
|
|
||
| - name: Build and deploy artifact | ||
| env: | ||
| GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
| run: mvn -B -e -DskipTests -Pdeploy clean deploy | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.