diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index da98105..b2cf8bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,26 +64,20 @@ jobs: --license GPLv3 - name: Check deb file run: ls -la dist/ - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: gotify-tray_${{ env.VERSION }}_amd64.deb - path: dist/gotify-tray_${{ env.VERSION }}_amd64.deb - - release: - runs-on: ubuntu-latest - needs: [build-deb] - steps: - - uses: actions/checkout@v4 - - name: Set version - run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV - - uses: actions/download-artifact@v1 - with: - name: gotify-tray_${{ env.VERSION }}_amd64.deb - - name: Release - uses: marvinpinto/action-automatic-releases@latest - with: - repo_token: "${{ secrets.GITEA_TOKEN }}" - prerelease: false - files: | - gotify-tray_${{ env.VERSION }}_amd64.deb + - name: Create release + run: | + RESPONSE=$(curl -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\": \"${GITHUB_REF_NAME}\", \"name\": \"Release ${GITHUB_REF_NAME}\", \"body\": \"Automated release\"}" \ + http://192.168.88.97:3000/api/v1/repos/kadu/gotify-tray-customized/releases) + echo "Release response: $RESPONSE" + RELEASE_ID=$(echo $RESPONSE | jq -r '.id') + echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV + - name: Upload asset + run: | + curl -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -H "Content-Type: application/octet-stream" \ + --data-binary @dist/gotify-tray_${VERSION}_amd64.deb \ + http://192.168.88.97:3000/api/v1/repos/kadu/gotify-tray-customized/releases/${RELEASE_ID}/assets?name=gotify-tray_${VERSION}_amd64.deb