Skip to content

Create Release Pull Request #5

Create Release Pull Request

Create Release Pull Request #5

name: Create Release Pull Request
permissions:
contents: read
on:
workflow_dispatch:
inputs:
git_tag:
description: Git Tag To Release From. Last Git Tag Is Used If Omitted
required: false
branch_name:
description: New Branch To Bump Crates
required: true
ockam_bump_modified_release:
description: Crates That Are To Follow A Different Release Version
required: false
ockam_bump_release_version:
description: Release Version
type: choice
default: minor
options:
- major
- minor
- patch
ockam_bump_bumped_dep_crates_version:
description: Crates That Are Bumped Due To Being Transitive Deps
type: choice
default: minor
options:
- major
- minor
- patch
# runs every command in bash (for every job in the workflow)
defaults:
run:
shell: bash
jobs:
bump_crates:
permissions:
# Contents permission allows us write to this repository.
contents: write
# Pull request write ability
pull-requests: write
name: Bump Crates And Create PR
runs-on: ubuntu-20.04
environment: release
container:
# Note: Do not update this image has it has installed all binaries
# to bump crates and generate changelogs which we don't want installed
# in our CI packages.
image: ghcr.io/build-trust/ockam-builder@sha256:b7790a79e5fd4265d8333bb882010e5d4326778f270bd49693fa35763865df82
steps:
- name: Checkout Ockam
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout To New Release Branch
id: commit
run: |
git checkout -B ${{ github.event.inputs.branch_name }}
sha=$(git rev-parse HEAD)
echo "sha=$sha" >> $GITHUB_OUTPUT
- name: Import GPG key
uses: build-trust/.github/actions/import_gpg@a6377d3c2dac878b92a0da26cdf3da2856c64840
with:
gpg_private_key: '${{ secrets.GPG_PRIVATE_KEY }}'
gpg_password: '${{ secrets.GPG_PASSPHRASE }}'
gpg_name: '${{ secrets.GPG_USER_NAME }}'
gpg_email: '${{ secrets.GPG_EMAIL }}'
- name: Bump Ockam
env:
OCKAM_BUMP_RELEASE_VERSION: '${{ github.event.inputs.ockam_bump_release_version }}'
OCKAM_BUMP_MODIFIED_RELEASE: '${{ github.event.inputs.ockam_bump_modified_release }}'
OCKAM_BUMP_BUMPED_DEP_CRATES_VERSION: '${{ github.event.inputs.ockam_bump_bumped_dep_crates_version }}'
GIT_TAG: '${{ github.event.inputs.git_tag }}'
run: bash -ex ./tools/scripts/release/crate-bump.sh
- name: Generate Changelogs
env:
GIT_TAG: '${{ github.event.inputs.git_tag }}'
run: bash -ex ./tools/scripts/release/changelog.sh
- name: Update Readme
run: make -f implementations/rust/Makefile update_readmes
- name: Push Update
run: |
# Squash commits
git reset ${{ steps.commit.outputs.sha }}
git add .
git commit -S -m "ci: crate release $(date +'%d-%m-%Y')"
git push --set-upstream origin ${{ github.event.inputs.branch_name }}