chore(deps): pin all GitHub Actions to allowed SHA versions #3
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
| name: Prepare Release | ||
|
Check failure on line 1 in .github/workflows/prepare-release.yml
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| description: the version to be released. If it ends with '.0' a proper release is created, bugfix otherwise | ||
| required: true | ||
| type: string | ||
| jobs: | ||
| Prepare-Release: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| RELEASE_REF: ${{ steps.commit-changes.outputs.RELEASE_REF }} | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: set release type | ||
| shell: bash | ||
| id: vars | ||
| run: | | ||
| type=bugfix | ||
| if [[ ${{ inputs.version }} == *0 ]] | ||
| then | ||
| type=release | ||
| fi | ||
| echo "type=$type" >> $GITHUB_OUTPUT | ||
| - uses: .github/actions/set-project-version | ||
| with: | ||
| version: ${{ inputs.version }}-SNAPSHOT | ||
| - name: Commit changes on ${{ steps.vars.outputs.type }}/${{ inputs.version }} branch | ||
| shell: bash | ||
| id: commit-changes | ||
| run: | | ||
| git config user.name "eclipse-edc-bot" | ||
| git config user.email "edc-bot@eclipse.org" | ||
| RELEASE_REF=${{ steps.vars.outputs.type }}/${{ inputs.version }} | ||
| git checkout -B $RELEASE_REF | ||
| git add . | ||
| git commit --allow-empty -m "Prepare ${{ steps.vars.outputs.type }} ${{ inputs.version }}" | ||
| # handle the case in which the branch already exist | ||
| git pull --rebase origin $RELEASE_REF || true | ||
| git push origin $RELEASE_REF | ||
| echo "RELEASE_REF=$RELEASE_REF" >> $GITHUB_OUTPUT | ||
| Bump-Main-Version: | ||
| if: github.ref_name == 'main' | ||
| needs: [ Prepare-Release ] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: main | ||
| - uses: .github/actions/setup-build | ||
| - uses: .github/actions/bump-version | ||
| with: | ||
| base_version: ${{ inputs.version }} | ||
| - uses: .github/actions/publish-maven-artifacts | ||
| with: | ||
| gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }} | ||
| gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }} | ||
| username: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} | ||
| password: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} | ||
| Publish-Bugfix-Snapshot: | ||
| if: github.ref_name != 'main' | ||
| needs: [ Prepare-Release ] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ needs.Prepare-Release.outputs.RELEASE_REF }} | ||
| - uses: .github/actions/setup-build | ||
| - uses: .github/actions/publish-maven-artifacts | ||
| with: | ||
| gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }} | ||
| gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }} | ||
| username: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} | ||
| password: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} | ||