From eed506c94a29c6497f46e1c6aec311d520567f8b Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sun, 2 Apr 2023 12:11:53 -0700 Subject: [PATCH] use curl for releases --- .github/workflows/release.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85f7eb5..b65444f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,12 +19,28 @@ jobs: - uses: ruby/setup-ruby@v1 with: bundler-cache: true + - run: bundle exec rake - - run: zip -rqj emoji.alfredsnippets build/* + - run: cd build && zip -rq ../emoji.alfredsnippets . - id: date run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - uses: ncipollo/release-action@v1 - with: - artifacts: emoji.alfredsnippets - tag: ${{ steps.date.outputs.DATE }} + - name: Create release + run: | + UPLOAD_URL="$( + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${{ github.repository }}/releases \ + -d '{"tag_name":"${{ steps.date.outputs.DATE }}","target_commitish":"${{ github.action_ref }}"}' \ + | jq --raw-output .upload_url)" + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + -H "Content-Type: application/zip" \ + "${UPLOAD_URL/'{?name,label}'/?name=emoji.alfredsnippets}" \ + --data-binary "@emoji.alfredsnippets"