Skip to content

Release: Bump

Release: Bump #19

Workflow file for this run

name: "Release: Bump"
on:
workflow_dispatch:
inputs:
force_version_bump:
required: false
default: ""
type: choice
options:
- ""
- patch
- minor
- major
jobs:
UnitTests:
name: Unit Tests
uses: ./.github/workflows/reuse_python_build.yml
with:
commit: ${{ github.sha }}
secrets: inherit
WindowsIntegrationTests:
needs: UnitTests
name: Windows Integration Tests
runs-on: windows-latest
permissions:
id-token: write
contents: read
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
env:
PYTHON: ${{ matrix.python-version }}
CODEARTIFACT_REGION: "us-west-2"
CODEARTIFACT_DOMAIN: ${{ secrets.CODEARTIFACT_DOMAIN }}
CODEARTIFACT_ACCOUNT_ID: ${{ secrets.CODEARTIFACT_ACCOUNT_ID }}
CODEARTIFACT_REPOSITORY: ${{ secrets.CODEARTIFACT_REPOSITORY }}
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_CODEARTIFACT_ROLE }}
aws-region: us-west-2
mask-aws-account-id: true
- name: Install Hatch
run: |
$CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain ${{ secrets.CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.CODEARTIFACT_ACCOUNT_ID }} --query authorizationToken --output text --region us-west-2)
echo "::add-mask::$CODEARTIFACT_AUTH_TOKEN"
echo CODEARTIFACT_AUTH_TOKEN=$CODEARTIFACT_AUTH_TOKEN >> $env:GITHUB_ENV
pip install --upgrade hatch
- name: Run Windows Integration Tests
run: hatch run integ-windows
IntegrationTests:
needs: UnitTests
name: Integration Tests
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_CODEBUILD_RELEASE_INTEG_ROLE }}
aws-region: us-west-2
mask-aws-account-id: true
- name: Run CodeBuild
uses: aws-actions/aws-codebuild-run-build@v1
with:
project-name: deadline-cloud-worker-agent-IntegTest
hide-cloudwatch-logs: true
env-vars-for-codebuild: |
TEST_TYPE
env:
TEST_TYPE: WHEEL
Bump:
needs: IntegrationTests
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: mainline
fetch-depth: 0
token: ${{ secrets.CI_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: ConfigureGit
run: |
git config --local user.email "[email protected]"
git config --local user.name "client-software-ci"
- name: Bump
run: |
BUMP_ARGS=""
if [[ "${{ inputs.force_version_bump }}" != "" ]]; then
BUMP_ARGS="$BUMP_ARGS --${{ inputs.force_version_bump }}"
fi
# Backup actual changelog to preserve its contents
touch CHANGELOG.md
cp CHANGELOG.md CHANGELOG.bak.md
# Run semantic-release to generate new changelog
pip install --upgrade hatch
hatch env create release
NEXT_SEMVER=$(hatch run release:bump $BUMP_ARGS)
# Grab the new version's changelog and prepend it to the original changelog contents
python .github/scripts/get_latest_changelog.py > NEW_LOG.md
cat NEW_LOG.md CHANGELOG.bak.md > CHANGELOG.md
rm NEW_LOG.md
git checkout -b bump/$NEXT_SEMVER
git add CHANGELOG.md
git commit -sm "chore(release): $NEXT_SEMVER"
echo "NEXT_SEMVER=$NEXT_SEMVER" >> $GITHUB_ENV
{
echo 'RELEASE_NOTES<<EOF'
python .github/scripts/get_latest_changelog.py
echo EOF
} >> $GITHUB_ENV
- name: PushPR
env:
GH_TOKEN: ${{ secrets.CI_TOKEN }}
run: |
git push -u origin bump/$NEXT_SEMVER
# Needs "Allow GitHub Actions to create and approve pull requests" under Settings > Actions
gh pr create --base mainline --title "chore(release): $NEXT_SEMVER" --body "$RELEASE_NOTES"