Add some composite actions (#18) #1
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 Tag | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "**/*" | |
- "!**/*.json" | |
- "!**/*.json5" | |
- "!**/*.md" | |
- "!.github/**" | |
- "!.gitignore" | |
- "!.pre-commit-config.yaml" | |
workflow_dispatch: | |
jobs: | |
tags: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
fetch-depth: 0 | |
- name: Bump version and push tag | |
id: bump-version | |
# yamllint disable-line rule:line-length | |
uses: anothrNick/github-tag-action@afe4b67b57b8ab0908e4767109a5342003639e2e # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
- name: Extract major tag | |
id: extract-major | |
run: >- | |
echo major_tag=$(echo ${{ steps.bump-version.outputs.new_tag }} | cut | |
-d'.' -f1) >> $GITHUB_OUTPUT | |
# this is done manually as need a non-annotated tag | |
# TODO: replace with https://github.com/actions/publish-action | |
- name: Update major tag | |
run: |- | |
git config user.name github-actions | |
git config user.email [email protected] | |
git tag --force ${{ steps.extract-major.outputs.major_tag }} \ | |
${{ steps.bump-version.outputs.new_tag }} | |
git push origin ${{ steps.extract-major.outputs.major_tag }} --force |