Skip to content
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

chore: defers tagging to post-merge #691

Merged
merged 32 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
29bbe60
Fix release branch name in bump step
NQuinn27 Sep 28, 2023
1be55c9
Use current branch
NQuinn27 Sep 28, 2023
567117c
Remove release candidate file and update release
NQuinn27 Sep 28, 2023
5a20883
Point PR to master
NQuinn27 Sep 28, 2023
bb313f7
Do not create tag in flow
NQuinn27 Sep 28, 2023
59aced4
Correct target branch for tests
NQuinn27 Sep 28, 2023
3ce7d3e
Install commitizen
NQuinn27 Sep 28, 2023
6f73c09
Use commit action
NQuinn27 Sep 28, 2023
4665865
add git push step
NQuinn27 Sep 28, 2023
8828abc
Manually commit
NQuinn27 Sep 28, 2023
8378341
Add files
NQuinn27 Sep 28, 2023
7f021c0
Debugging
NQuinn27 Sep 28, 2023
9105b03
Remove PR Step
NQuinn27 Sep 28, 2023
d00cd71
Dont create the commit
NQuinn27 Sep 28, 2023
406974d
Use versions in PR name and Body
NQuinn27 Sep 28, 2023
b61d76f
Clean up workflow
NQuinn27 Sep 28, 2023
d73c7df
Test tagging flow
NQuinn27 Sep 28, 2023
15f9d86
correct var
NQuinn27 Sep 28, 2023
faada55
Remove test code
NQuinn27 Sep 28, 2023
07943fa
Added post-merge script
NQuinn27 Sep 28, 2023
38101ef
Correct base branch
NQuinn27 Sep 28, 2023
c2f9276
Clean up workflow files
NQuinn27 Sep 29, 2023
92a8e39
Adds release creation step
NQuinn27 Sep 29, 2023
22e72a8
Tag off the release branch, not master
NQuinn27 Sep 29, 2023
e93c958
Remove redundant branch check
NQuinn27 Oct 2, 2023
192e291
Re-enable deleting of branch and use head_sha
NQuinn27 Oct 2, 2023
f55f27c
Remove unused second part of if
NQuinn27 Oct 2, 2023
80ca16f
Rename post-release workflow and remove tagging workflow
NQuinn27 Oct 3, 2023
dde5c1d
Better workflow naming
NQuinn27 Oct 3, 2023
20385b9
Merge branch 'master' into nq/release_flow_tests
NQuinn27 Oct 3, 2023
b44f2c1
make tagging manual
NQuinn27 Oct 4, 2023
3a01915
Merge branch 'nq/release_flow_tests' of github.com:primer-io/primer-s…
NQuinn27 Oct 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/workflows/create-release-candidate.yml

This file was deleted.

39 changes: 28 additions & 11 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ name: Create Release

on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release Type'
required: true
type: choice
options:
- default
- alpha
- beta
- rc

jobs:
bump-version:
Expand All @@ -13,25 +23,32 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_ACCESS_TOKEN }}
- name: Install cz
run: pip install --user -U Commitizen
- name: Record from version
run: |
echo "FROM_VERSION=$(cz version --project)" >> $GITHUB_ENV
- name: Create release branch
run: |
git checkout -b release/next
git push -u origin release/next
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.RELEASE_ACCESS_TOKEN }}
branch: release
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
# Bump version and create CHANGELOG - default release
- name: Create bump and changelog
if: ${{ inputs.releaseType == 'default' }}
run: cz bump --files-only --yes --changelog
# Bump version and create CHANGELOG - prereleasee
- name: Create bump and changelog
if: ${{ inputs.releaseType != 'default' }}
run: cz bump --files-only --yes --changelog --prerelease ${{ inputs.releaseType }}
- name: Record to version
run: |
echo "TO_VERSION=$(cz version --project)" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.RELEASE_ACCESS_TOKEN }}
base: master
branch: release/next
delete-branch: true
title: Release ${{ steps.cz.outputs.version }}
body: ''

title: Release ${{ env.TO_VERSION }}
body: 'Bumped ${{ env.FROM_VERSION}} -> ${{ env.TO_VERSION }}'
34 changes: 34 additions & 0 deletions .github/workflows/post-release-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Post Release PR Merge

on:
pull_request:
# Patterns matched against refs/heads
branches:
- release/next
types: [ closed ]

jobs:
release_merge:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Git - Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.RELEASE_ACCESS_TOKEN }}
- name: Install cz
run: pip install --user -U Commitizen
- name: Record release version
run: |
echo "RELEASE_VERSION=$(cz version --project)" >> $GITHUB_ENV
- name: Tag release
run: |
git tag $RELEASE_VERSION
git push origin $RELEASE_VERSION
- name: Create a Release
uses: elgohr/Github-Release-Action@v4
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_ACCESS_TOKEN }}
with:
title: Release ${{ env.RELEASE_VERSION }}