diff --git a/.gitea/workflows/create-release-old.yml b/.gitea/workflows-disabled/create-release-old.yml similarity index 100% rename from .gitea/workflows/create-release-old.yml rename to .gitea/workflows-disabled/create-release-old.yml diff --git a/.gitea/workflows/create-release.yml b/.gitea/workflows/create-release.yml index f2b2dc9..b576121 100644 --- a/.gitea/workflows/create-release.yml +++ b/.gitea/workflows/create-release.yml @@ -13,12 +13,12 @@ on: value: ${{ jobs.create_release.outputs.success }} jobs: - create_release: + get_next_release: name: Create Release runs-on: ubuntu-latest - # needs: test outputs: release_name: ${{ steps.get_next_version.outputs.tag }} + changelog: ${{ steps.get_next_version.outputs.changelog }} steps: - name: Check out repository uses: actions/checkout@v4.2.2 @@ -68,11 +68,26 @@ jobs: skip-version-file: true skip-tag: true + create_release: + name: Create Release + runs-on: ubuntu-latest + needs: get_next_release + outputs: + success: ${{ steps.set_flag.outputs.success }} + steps: + - name: Check out repository + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + - name: Create release - run: | - curl -s -X POST \ - -H "Authorization: token ${{ secrets.ACTIONS_TOKEN }}" \ - -H "accept: application/json" \ - -H "Content-Type: application/json" \ - -d "{\"tag_name\": \"${{ steps.get_next_version.outputs.tag }}\", \"name\": \"${{ steps.get_next_version.outputs.tag }}\", \"body\": \"${{ steps.get_next_version.outputs.changelog }}\"}" \ - "${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases" + uses: https://git.tainton.uk/actions/create-release-action@v1.0.0 + with: + release_name: ${{ needs.get_next_release.outputs.release_name }} + tag: ${{ needs.get_next_release.outputs.release_name }} + body: ${{ needs.get_next_release.outputs.changelog }} + + - name: Set success/fail flag + id: set_flag + if: steps.changes.outputs.changes == 'true' + run: echo "success=true" >> "$GITEA_OUTPUT"