diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 298458d..5d69915 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -124,14 +124,26 @@ jobs: git push https://${{ gitea.actor }}:${{ gitea.token }}@git.produktor.io/${{ gitea.repository }}.git "${{ steps.version.outputs.new_tag }}" - name: Create Gitea Release - uses: https://gitea.com/actions/gitea-release-action@v1 - with: - server_url: ${{ gitea.server_url }} - token: ${{ gitea.token }} - tag_name: ${{ steps.version.outputs.new_tag }} - name: FleetDM Stack ${{ steps.version.outputs.new_tag }} - body: | - **${{ steps.version.outputs.bump_type }}** release — `${{ steps.version.outputs.new_tag }}` + run: | + TAG="${{ steps.version.outputs.new_tag }}" + BUMP="${{ steps.version.outputs.bump_type }}" + API="https://git.produktor.io/api/v1/repos/${{ gitea.repository }}/releases" + TOKEN="${{ gitea.token }}" - Helm chart for FleetDM Server with MySQL and Redis. - files: .tmp/*.tgz + # Create release + RELEASE=$(curl -sf -X POST "$API" \ + -H "Authorization: token $TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"$TAG\",\"name\":\"FleetDM Stack $TAG\",\"body\":\"**${BUMP}** release — \`${TAG}\`\n\nHelm chart for FleetDM Server with MySQL and Redis.\"}") + RELEASE_ID=$(echo "$RELEASE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) + echo "Created release ID: $RELEASE_ID" + + # Upload chart package + for f in .tmp/*.tgz; do + FNAME=$(basename "$f") + curl -sf -X POST "$API/$RELEASE_ID/assets?name=$FNAME" \ + -H "Authorization: token $TOKEN" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@$f" + echo "Uploaded: $FNAME" + done