Skip to content

metanorma/packed-mn #130

metanorma/packed-mn

metanorma/packed-mn #130

Workflow file for this run

name: release-tag
on:
repository_dispatch:
types: [ metanorma/packed-mn ]
workflow_dispatch:
inputs:
next_version:
description: |
Next release version.
required: true
jobs:
push-tag:
runs-on: ubuntu-20.04
if: startsWith(github.event.client_payload.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
- if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo SNAP_VERSION=${{ github.event.inputs.next_version }} >> ${GITHUB_ENV}
- if: ${{ github.event_name == 'repository_dispatch' }}
run: echo SNAP_VERSION=${METANORMA_CLI_TAG#*/v} >> ${GITHUB_ENV}
env:
METANORMA_CLI_TAG: ${{ github.event.client_payload.ref }}
- run: |
sudo apt update && sudo apt install -y snapd
sudo snap install yq
- run: ./snap-set-version.sh ${SNAP_VERSION}
- name: Push commit and tag
run: |
git config --global user.name "metanorma-ci"
git config --global user.email "[email protected]"
git add snap/snapcraft.yaml
git commit -m "Bump version to ${SNAP_VERSION}"
git tag v${SNAP_VERSION}
git push origin HEAD:${GITHUB_REF} --tags