diff --git a/.gitea/workflows/02_release.yml b/.gitea/workflows/02_release.yml new file mode 100644 index 0000000..98f4726 --- /dev/null +++ b/.gitea/workflows/02_release.yml @@ -0,0 +1,35 @@ +# Credit: https://gitea.com/gitea/runner-images/src/branch/main/.gitea/workflows/release.yaml +name: Release new version +run-name: Release ${{ github.ref_name }} + +on: + push: + tags: + - "*" + +jobs: + release: + runs-on: ubuntu-latest + container: docker.io/thegeeklab/git-sv:2.0.9 + steps: + - name: Install tools + run: | + apk add -q --update --no-cache nodejs + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-tags: true + fetch-depth: 0 + + - name: Create changelog + run: | + git sv current-version + git sv release-notes -t ${GITHUB_REF#refs/tags/} -o CHANGELOG.md + sed -i '1,2d' CHANGELOG.md # remove version + cat CHANGELOG.md + + - name: Release + uses: https://github.com/akkuman/gitea-release-action@v1 + with: + body_path: CHANGELOG.md + token: "${{ secrets.REPO_RW_TOKEN }}" diff --git a/.gitea/workflows/99_changelog.yml b/.gitea/workflows/99_changelog.yml index 9247283..78b2b9f 100644 --- a/.gitea/workflows/99_changelog.yml +++ b/.gitea/workflows/99_changelog.yml @@ -34,4 +34,4 @@ jobs: curl -s -X POST "https://gitea.7o7.cx/api/v1/repos/sherl/Shadow/issues" -H "Authorization: token ${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA" > /dev/null else curl -s -X PATCH "https://gitea.7o7.cx/api/v1/repos/sherl/Shadow/issues/$ISSUE_NUMBER" -H "Authorization: token ${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA" > /dev/null - fi \ No newline at end of file + fi