Added README and release workflow for versioning
All checks were successful
Release / release (push) Successful in 1m20s
All checks were successful
Release / release (push) Successful in 1m20s
This commit is contained in:
56
.gitea/workflows/release.yml
Normal file
56
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,56 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build changelog
|
||||
id: changelog
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch --tags --force
|
||||
current_tag="${GITEA_REF_NAME}"
|
||||
previous_tag="$(git tag --sort=-creatordate | grep -v "^${current_tag}$" | head -n 1)"
|
||||
if [ -n "$previous_tag" ]; then
|
||||
range="${previous_tag}..${current_tag}"
|
||||
header="Changes since ${previous_tag}"
|
||||
else
|
||||
range="${current_tag}"
|
||||
header="Initial release"
|
||||
fi
|
||||
{
|
||||
echo "notes<<EOF"
|
||||
echo "## ${header}"
|
||||
git log "${range}" --pretty=format:"- %s (%h)" --no-merges
|
||||
echo
|
||||
echo "EOF"
|
||||
} >> "$GITEA_OUTPUT"
|
||||
|
||||
- name: Package extension
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p dist
|
||||
zip -r "dist/json-content-formatter-${GITEA_REF_NAME}.zip" \
|
||||
. \
|
||||
-x ".git/*" \
|
||||
-x ".gitea/*" \
|
||||
-x "dist/*"
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body: ${{ steps.changelog.outputs.notes }}
|
||||
files: dist/json-content-formatter-${{ gitea.ref_name }}.zip
|
||||
Reference in New Issue
Block a user