Branch snap #88
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: Branch snap | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| releaseCandidate: | |
| description: 'Is this a release candidate snap from main? (Will increment main version to be higher than next stable release)' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| check-script: | |
| uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main | |
| with: | |
| configuration_file_path: '.config/snap-flow.json' | |
| bump-main-version: | |
| needs: check-script | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Install NodeJS | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Update version.json | |
| run: | | |
| if [ "${{ github.event.inputs.releaseCandidate }}" = "true" ]; then | |
| npx gulp incrementVersion --releaseCandidate=true | |
| else | |
| npx gulp incrementVersion | |
| fi | |
| - name: Create version update PR | |
| uses: peter-evans/create-pull-request@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: Update main version | |
| title: '[automated] Update main version' | |
| branch: merge/update-main-version | |
| update-release-version: | |
| needs: check-script | |
| if: github.ref == 'refs/heads/prerelease' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out merge branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: merge/prerelease-to-release | |
| fetch-depth: 0 | |
| - name: Install NodeJS | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Update version.json for release | |
| run: npx gulp updateVersionForStableRelease | |
| - name: Create PR with version update | |
| uses: peter-evans/create-pull-request@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: Update version for stable release | |
| branch: merge/prerelease-to-release | |
| base: release |