Skip to content

Release

Release #47

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
title:
description: 'Release Title'
required: false
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: Install tools
# gridsite-clients is required for urlencode
run: sudo apt update && sudo apt install -y gridsite-clients
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run build
run: ci/build.sh
- name: Get Latest Tag
id: latest_tag
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
- name: Get Body
id: get_body
run: |
git log --pretty=format:"* %s" ${{ steps.latest_tag.outputs.release }}..HEAD > body.md
- name: Set Tag
id: set_tag
run: |
baseTag=$(date +v%y.%-m.%-d)
tag=$baseTag
count=1
while [ $(git tag -l "$tag") ];
do
tag=$baseTag.$count;
count=$(($count+1));
done
echo tag=$tag >> $GITHUB_OUTPUT
- name: Set Name
id: set_name
run: |
if [[ "${{ github.event.inputs.title }}" != "" ]]; then
echo name="${{ steps.set_tag.outputs.tag }} - ${{ github.event.inputs.title }}" >> $GITHUB_OUTPUT
else
echo name=${{ steps.set_tag.outputs.tag }} >> $GITHUB_OUTPUT
fi
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit: ${{ github.sha }}
tag: ${{ steps.set_tag.outputs.tag }}
name: ${{ steps.set_name.outputs.name }}
token: ${{ secrets.GITHUB_TOKEN }}
bodyFile: body.md
generateReleaseNotes: true