ci: test with release action

This commit is contained in:
2025-09-20 10:26:10 +02:00
parent dcbd133e7f
commit b0ca2a26a1
4 changed files with 36 additions and 31 deletions

View File

@@ -2,9 +2,6 @@ name: Release
on:
workflow_dispatch:
permissions:
contents: read # for checkout
jobs:
release:
name: Release
@@ -16,5 +13,32 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare git
run: |
git config --global user.email "gitea@bjornp.com"
git config --global user.name "gitea-actions"
- name: Determine release version and changelog
run: npx semantic-release
run: npx commit-and-tag-version
- name: Build release
working-directory: src
run: |
VERSION=$(jq '.version' info.json | xargs echo -n)
zip -r ../prometheus-exporter_$VERSION.zip .
- name: Push changelog and tag
run: git push --follow-tags
- name: Get latest tag
id: tag
run: echo tag="$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- name: Create release
uses: akkuman/gitea-release-action@v1
with:
files: prometheus-exporter_*.zip
body_path: CHANGELOG.md
name: ${{ steps.tag.outputs.tag }}
tag_name: ${{ steps.tag.outputs.tag }}
md5sum: true