Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusauler committed Jul 25, 2024
1 parent cabb8dc commit de4d8b1
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags:
- "*.*.*-fork"

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: true

- name: Test version
run: |
version=$(./wt version 2> /dev/null | sed 's/Version: //')
tag=$(echo ${{ github.ref }} | sed 's|^refs/tags/||')
[[ $tag == $version ]]
- name: Changelog
id: changelog
run: |
{
echo 'changelog<<EOF'
echo 'Commits since last release:'
git log --pretty=format:'%D' \
| sed -nE '/tag:/{s/^(.+, )?tag: ([0-9\.\]+(-fork)?)(,.*)?$/\2/;p}' \
| head -2 \
| tac \
| xargs printf "%s..%s" \
| xargs git log --format="- %h %s"
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Release
uses: softprops/action-gh-release@v2.0.8
with:
body: ${{ steps.changelog.outputs.changelog }}
files: |
wt
completions/*

0 comments on commit de4d8b1

Please sign in to comment.