Skip to content

release

release #36

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
default: 'latest'
required: false
schedule:
- cron: "0 2 * * *"
jobs:
release:
runs-on: ubuntu-latest
steps:
- id: runner
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: indico
repo: indico
excludes: prerelease, draft
- name: Tag name
id: tag
run: |
SRC_TAG=${{ steps.runner.outputs.release }}
echo "Upstream release = indico/indico-containers: ${SRC_TAG}"
if [ "${{ github.event.inputs.version || 'latest' }}" = "latest" ]; then
export TAG="${SRC_TAG#v}"
else
export TAG="${{ github.event.inputs.version }}"
fi
echo "Generating tag: $TAG"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
- uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ steps.tag.outputs.tag }}
- name: Create Release
if: ${{ steps.checkTag.outputs.exists == 'false' }}
uses: actions/github-script@v7
with:
github-token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.tag.outputs.tag }}",
sha: context.sha
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/${{ steps.tag.outputs.tag }}",
sha: context.sha
});
})