Skip to content

Create Release

Create Release #49

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"
sha=$(git rev-parse HEAD)
git archive --format=tar --prefix="${NAME}-${TAG}/" $sha | gzip > "${NAME}-${TAG}.tar.gz"
gh release create "v$TAG" --title "$TAG" --target $sha --generate-notes "${NAME}-${TAG}.tar.gz"
env:
NAME: "rules_poetry"
TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}