Make release #5
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
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "version to release, e.g. v1.5.13" | |
| required: true | |
| default: "v0.1.0" | |
| source_ref: | |
| description: "source ref to publish from. E.g.: main or release-x.y" | |
| required: true | |
| default: "main" | |
| pre_release: | |
| description: "Is release a pre-release ? " | |
| required: true | |
| default: false | |
| type: boolean | |
| name: Make release | |
| jobs: | |
| create-release-branch: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Allows pushing branches | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Ensure full history | |
| ref: ${{ github.event.inputs.source_ref }} | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "[email protected]" | |
| - name: Create and push new branch | |
| env: | |
| VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| NEW_BRANCH="release-${VERSION}" | |
| git checkout -b $NEW_BRANCH | |
| git push origin $NEW_BRANCH | |
| release: | |
| name: Make release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - create-release-branch | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.version }} | |
| name: Release ${{ github.event.inputs.version }} | |
| draft: false | |
| prerelease: ${{ github.event.inputs.pre_release }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| generate_release_notes: true | |
| append_body: true |