From f261a9ddb1737daa2b66708a2dfc7fe088c75d05 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Wed, 11 Dec 2024 14:54:46 +0000 Subject: [PATCH] Create initial set_version.yml This action doesn't make any changes to the code yet: to develop a workflow_dispatch action we need to have _something_ on the default branch so it can be launched and tested. --- .github/workflows/set_version.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/set_version.yml diff --git a/.github/workflows/set_version.yml b/.github/workflows/set_version.yml new file mode 100644 index 000000000..05f8f96c7 --- /dev/null +++ b/.github/workflows/set_version.yml @@ -0,0 +1,40 @@ +name: "Write version number and tag" + +on: + workflow_dispatch: + inputs: + ref: + description: "Target branch, tag or SHA" + required: true + type: string + version: + description: "New version number" + required: true + type: string + +jobs: + show-branch: + runs-on: ubuntu-latest + + steps: + - name: Show input parameters + shell: bash -l {0} + run: | + echo "${{ inputs.ref }}" + echo "${{ inputs.version }}" + + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + fetch-tags: true + fetch-depth: 0 + + - name: "Tag locally" + shell: bash -l {0} + run: | + git tag ${{ inputs.version }} + + - name: "Show updated log" + shell: bash -l {0} + run: | + git log --pretty=oneline --abbrev-commit --decorate | head