From bce5ab64ebce3f367def28de89b436b843b92b32 Mon Sep 17 00:00:00 2001 From: loyalsoldier Date: Sun, 1 Mar 2020 13:04:29 +0800 Subject: [PATCH] Test with another release action --- .github/workflows/build.yml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9810fe3..4dd7fca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,28 +122,14 @@ jobs: sha256sum geoip.dat > geoip.dat.sha256sum sha256sum geosite.dat > geosite.dat.sha256sum - - name: Create a release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release and upload assets + uses: softprops/action-gh-release@v1 with: + name: ${{ env.RELEASE_NAME }} tag_name: ${{ env.TAG_NAME }} - release_name: ${{ env.RELEASE_NAME }} draft: false prerelease: false - - - name: Upload assets + files: | + ./publish/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - release_id: ${{ steps.create_release.outputs.id }} - run: | - files=$(ls ./publish) - for ASSET in ${files}; do - FILEPATH="./publish/${ASSET}" - FILETYPE=$(file -b --mime-type "${FILEPATH}") - CONTENT_TYPE_HEADER="Content-Type: ${FILETYPE}" - AUTH_HEADER="Authorization: token ${{ env.GITHUB_TOKEN }}" - URL="https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.release_id }}/assets?name=${ASSET}" - curl -sSL -X POST -H "${AUTH_HEADER}" -H "${CONTENT_TYPE_HEADER}" --data-binary @${FILEPATH} ${URL} - done