File: bump-version.yml

package info (click to toggle)
sshcommand 0.20.1-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 196 kB
  • sloc: sh: 379; makefile: 170
file content (52 lines) | stat: -rw-r--r-- 1,316 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
name: "bump-version"

# yamllint disable-line rule:truthy
on:
  workflow_dispatch:
    inputs:
      bump_type:
        description: "Bump type"
        default: "patch"
        required: true
        type: choice
        options:
          - patch
          - minor
          - major

env:
  GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

jobs:
  bump-version:
    name: bump-version
    runs-on: ubuntu-24.04

    steps:
      - name: Checkout
        uses: actions/checkout@v5
        with:
          fetch-depth: 0
          token: ${{ env.GITHUB_ACCESS_TOKEN }}

      - name: Get Latest Tag
        id: latest-tag
        run: |
          echo GIT_LATEST_TAG="$(git describe --tags "$(git rev-list --tags --max-count=1)")" >>"$GITHUB_OUTPUT"

      - name: Compute Next Tag
        id: next-tag
        uses: docker://ghcr.io/dokku/semver-generator:latest
        with:
          bump: ${{ github.event.inputs.bump_type }}
          input: ${{ steps.latest-tag.outputs.GIT_LATEST_TAG }}

      - name: Create and Push Tag
        run: |
          git config --global user.name 'Dokku Bot'
          git config --global user.email no-reply@dokku.com
          git tag "$GIT_NEXT_TAG"
          git push origin "$GIT_NEXT_TAG"
        env:
          GIT_NEXT_TAG: ${{ steps.next-tag.outputs.version }}