feat: update project pom.xml (CI-494) #1
Workflow file for this run
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
| ################################################## | |
| ## GitHub Action Workflow File | |
| ## Designed for ArteGEIE | |
| ## | |
| ## Description : | |
| ## This workflow creates a release once a PR is merged into the main branch. | |
| ## It creates a "minor" release if the PR was untitled "feat: xxx" and creates a patch otherwise. | |
| ## | |
| ## Automatic Trigger when a Pull Request is closed | |
| ## | |
| name: "Create an automatic release" | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - '.github/**' | |
| types: | |
| - closed | |
| jobs: | |
| create-release: | |
| name: Create release | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event.pull_request.merged == true | |
| && ( github.event.pull_request.base.ref == 'master' || github.event.pull_request.base.ref == 'main') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ArteGEIE/github-actions-common/debug@0.55 | |
| - name: Load env var | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| source .infrastructure/env/.env || true | |
| if echo "${PR_TITLE}" | grep -q "feat:"; then | |
| RELEASE_LEVEL='minor' | |
| else | |
| RELEASE_LEVEL='patch' | |
| fi | |
| if [[ "${INFRA_RELEASE_DRAFT}" == "true" ]]; then | |
| RELEASE_TYPE='draft' | |
| else | |
| RELEASE_TYPE='auto' | |
| fi | |
| echo "release_level=${RELEASE_LEVEL}" >> $GITHUB_ENV | |
| echo "release_type=${RELEASE_TYPE}" >> $GITHUB_ENV | |
| echo "main_branch_name=${INFRA_MAIN_BRANCH_NAME:-master}" >> $GITHUB_ENV | |
| - uses: actions/create-github-app-token@v1 | |
| name: Generate a token | |
| id: generate_token | |
| with: | |
| app-id: ${{ secrets.SHARED_WORKFLOW_GITHUB_APP_ID }} | |
| private-key: ${{ secrets.SHARED_WORKFLOW_GITHUB_APP_PRIVATE_KEY }} | |
| - name: Create release | |
| uses: ArteGEIE/github-actions-common/create-release@0.55 | |
| with: | |
| release_level: ${{ env.release_level }} | |
| release_type: ${{ env.release_type }} | |
| main_branch_name: ${{ env.main_branch_name }} | |
| github_token: ${{ steps.generate_token.outputs.token }} |