Skip to content

Create Release

Create Release #53

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
inputs:
tag:
description: 'The new version to tag, ex: 1.0.5'
required: true
type: string
jobs:
create-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Release
run: |
set -euo pipefail
git config user.name "${{ github.triggering_actor }}"
git config user.email "${{ github.triggering_actor }}@users.noreply.github.com"
export PREFIX="${NAME}-${TAG}"
export ARCHIVE="$PREFIX.tar.gz"
sha=$(git rev-parse HEAD)
git archive --format=tar --prefix="${NAME}-${TAG}/" $sha | gzip > $ARCHIVE
export SHA256=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
env
cat .github/workflows/release_notes.md | envsubst > notes.md
cat notes.md
gh release create "v$TAG" --title "$TAG" --target $sha --generate-notes --notes "$(cat notes.md)" $ARCHIVE
env:
NAME: "rules_poetry"
TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}