diff --git a/.gitea/workflows/go.yml b/.gitea/workflows/go.yml index 4adc376..08e4290 100644 --- a/.gitea/workflows/go.yml +++ b/.gitea/workflows/go.yml @@ -13,10 +13,9 @@ jobs: release: runs-on: ubuntu-docker steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: setup go + - name: Check out repository code + uses: actions/checkout@v4 + - name: Setup go uses: actions/setup-go@v4 with: go-version: '>=1.x' @@ -33,10 +32,19 @@ jobs: - name: release-build-darwin-arm64 run: GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-darwin-arm64 - - name: Use Go Action - id: use-go-action - uses: softprops/action-gh-release - with: - files: |- - bin/** - api_key: '${{secrets.RELEASE_TOKEN}}' + - name: Create Release + id: create_release + env: + GITEA_TOKEN: ${{ secrets.CI_PACKAGES_RW }} + run: | + RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" -H "Authorization: token ${GITEA_TOKEN}" \ + -d '{ + "tag_name": "${{ github.ref_name }}", + "target_commitish": "main", + "name": "Release ${{ github.ref_name }}", + "body": "Description of the release", + "draft": false, + "prerelease": false + }' \ + "https://git.hollander.online/api/v1/repos/${{ gitea.repository_owner }}/${{ gitea.event.repository.name }}/releases") + echo "::set-output name=id::$(echo $RESPONSE | jq .id)"