Skip to content

Commit

Permalink
Add automatically generated releases on tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Dec 8, 2023
1 parent 3653d3e commit f825df1
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
changelog:
exclude:
authors:
- dependabot
categories:
- title: Added
labels:
- enhancement
- title: Fixed
labels:
- bug
- title: Changed
labels:
- "*"
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: GitHub Release

on:
pull_request:

push:
branches:
- "trunk"
tags:
- "v*"

workflow_dispatch:

permissions:
contents: write

defaults:
run:
shell: bash

jobs:
release:
name: Publish [GitHub]
runs-on: ubuntu-latest

steps:
- name: Determine version number
id: version
run: |
TAG=${{ github.ref_name }}
# Remove v from start of tag name
VERSION=${TAG#v}
# Replace / with - in merge names
VERSION=${VERSION//\//-}
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "name=${{ github.event.repository.name }}-${VERSION}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
path: ${{ steps.version.outputs.name }}

- name: Remove .git
run: |
rm -rf ${{ steps.version.outputs.name }}/.git
ls -laR ${{ steps.version.outputs.name }}
- name: Tar source
run: tar --zstd -cvf ${{ steps.version.outputs.name }}.tar.zst ${{ steps.version.outputs.name }}

- name: Create release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "*.tar.zst"
name: ${{ steps.version.outputs.version }}
generate_release_notes: True
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f825df1

Please sign in to comment.