Skip to content

Commit

Permalink
setting up for first release
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Bray <tbray@textuality.com>
  • Loading branch information
timbray committed Apr 11, 2024
1 parent ce168dc commit 5b6791a
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
# release will only be created when ref is a tag starting with "v"
push:
tags:
- "v*"

workflow_dispatch:
inputs:
tag:
required: true
type: string
description: Use this existing Git tag to create the release

jobs:
release:
name: Create Release
timeout-minutes: 10
strategy:
matrix:
go-version: ["1.19"]
platform: ["ubuntu-latest"]
runs-on: ${{ matrix.platform }}
env:
TAG: ${{ github.event.inputs.tag }}

steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
fetch-depth: 0
ref: "main"

- name: Get short TAG
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
echo "Retrieving tag from Github ref"
echo "TAG=$(basename "${{ github.ref }}")" >> $GITHUB_ENV
- name: Create CHANGELOG for Release (tag)
env:
IMAGE: quay.io/git-chglog/git-chglog
# https://quay.io/repository/git-chglog/git-chglog from tag v0.14.2
IMAGE_SHA: 998e89dab8dd8284cfff5f8cfb9e9af41fe3fcd4671f2e86a180e453c20959e3
run: |
# generate CHANGELOG for this Github release tag only
echo "Using tag $TAG to create release notes"
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o RELEASE_CHANGELOG.md $TAG
# send to job summary
cat RELEASE_CHANGELOG.md >> $GITHUB_STEP_SUMMARY
- name: Create Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Using tag $TAG to create release"
gh release create -F RELEASE_CHANGELOG.md ${TAG} LICENSE README.md

0 comments on commit 5b6791a

Please sign in to comment.