Skip to content

Deploying RF24 master #65

Deploying RF24 master

Deploying RF24 master #65

name: Bump version and release
on:
workflow_dispatch:
inputs:
repo:
description: >-
The name of the nRF24 project to deploy.
type: choice
required: true
options:
- "RF24"
- "RF24Network"
- "RF24Mesh"
- "RF24Gateway"
- "RF24Ethernet"
- "RF24Audio"
- "CircuitPython_nRF24L01"
- "pyRF24"
branch:
description: >-
The name of the `project` default branch from which to deploy.
type: string
required: true
default: master
bump-component:
description: >-
Which version component should be bumped?
type: choice
default: 'patch'
required: true
options:
- 'major'
- 'minor'
- 'patch'
run-name: Deploying ${{ inputs.repo }} ${{ inputs.branch }}
permissions: {}
jobs:
release-version-bump:
runs-on: ubuntu-latest
# permissions required for secrets.BUMP_N_RELEASE token:
# contents: write # to `git push` and create releases
# pull-requests: read # to read PR info when regenerating the changelog
steps:
- name: Checkout ${{ inputs.repo }}
uses: actions/checkout@v6
with:
persist-credentials: true # needed for `git push`
repository: nRF24/${{ inputs.repo }}
ref: ${{ inputs.branch }}
fetch-depth: 0
path: ${{ inputs.repo }}
token: ${{ secrets.BUMP_N_RELEASE }} # zizmor: ignore[secrets-outside-env]
- name: Checkout org repo
uses: actions/checkout@v6
with:
persist-credentials: false
path: org-repo
- uses: actions/setup-python@v6
with:
python-version: ">=3.10"
- name: Install git-cliff
run: pip install -r org-repo/.github/requirements.txt
- name: Increment version
working-directory: ${{ inputs.repo }}
id: inc-ver
env:
# needed by git-cliff to regenerate changelog
GITHUB_TOKEN: ${{ secrets.BUMP_N_RELEASE }} # zizmor: ignore[secrets-outside-env]
BUMP_COMPONENT: ${{ inputs.bump-component }}
run: >-
python "../org-repo/.github/increment_version.py"
--bump="${BUMP_COMPONENT}"
--update-metadata
- name: Push metadata changes
working-directory: ${{ inputs.repo }}
if: steps.inc-ver.outputs.made-changes == 'true'
env:
TAG: v${{ steps.inc-ver.outputs.new-version }}
run: |-
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git add --all
git commit -m "bump version to ${TAG}"
git push
- name: Publish release
env:
GH_TOKEN: ${{ secrets.BUMP_N_RELEASE }} # zizmor: ignore[secrets-outside-env]
REPO: nRF24/${{ inputs.repo }}
BRANCH: ${{ inputs.branch }}
TAG: v${{ steps.inc-ver.outputs.new-version }}
NOTES: ${{ steps.inc-ver.outputs.release-notes }}
run: >-
gh release create "${TAG}"
--notes-file "${NOTES}"
--repo "${REPO}"
--target "${BRANCH}"
--title "${TAG}"