Deploying pyRF24 main #24
This file contains 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: Bump version and release | |
on: | |
workflow_dispatch: | |
inputs: | |
repo: | |
type: choice | |
required: true | |
options: | |
- "RF24" | |
- "RF24Network" | |
- "RF24Mesh" | |
- "RF24Gateway" | |
- "RF24Ethernet" | |
- "RF24Audio" | |
- "CircuitPython_nRF24L01" | |
- "pyRF24" | |
branch: | |
type: string | |
required: true | |
default: master | |
bump-component: | |
type: choice | |
default: 'patch' | |
required: true | |
options: | |
- 'major' | |
- 'minor' | |
- 'patch' | |
run-name: Deploying ${{ inputs.repo }} ${{ inputs.branch }} | |
jobs: | |
release-version-bump: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout ${{ inputs.repo }} | |
uses: actions/checkout@v4 | |
with: | |
repository: nRF24/${{ inputs.repo }} | |
ref: ${{ inputs.branch }} | |
fetch-depth: 0 | |
path: ${{ inputs.repo }} | |
token: ${{ secrets.BUMP_N_RELEASE }} | |
- name: checkout org repo | |
uses: actions/checkout@v4 | |
with: | |
path: org-repo | |
- uses: actions/setup-python@v5 | |
with: | |
# here we need v3.10+ | |
python-version: 3.x | |
- run: rustup update --no-self-update | |
- name: Install cargo-binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Install git-cliff | |
run: cargo binstall -y git-cliff --install-path org-repo | |
- name: increment version | |
working-directory: ${{ inputs.repo }} | |
id: inc-ver | |
run: >- | |
python "../org-repo/.github/workflows/increment_version.py" | |
--bump=${{ inputs.bump-component }} | |
--update-metadata | |
- name: push metadata changes | |
working-directory: ${{ inputs.repo }} | |
if: steps.inc-ver.outputs.made-changes == 'true' | |
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 v${{ steps.inc-ver.outputs.new-version }}" | |
git push | |
- name: publish release | |
env: | |
GH_TOKEN: ${{ secrets.BUMP_N_RELEASE }} | |
run: >- | |
gh release create | |
v${{ steps.inc-ver.outputs.new-version }} | |
--notes-file ${{ steps.inc-ver.outputs.release-notes }} | |
--repo nRF24/${{ inputs.repo }} | |
--target ${{ inputs.branch }} | |
--title v${{ steps.inc-ver.outputs.new-version }} |