diff --git a/.github/workflows/compressandrelease.yaml b/.github/workflows/compressandrelease.yaml index e78d0ec..16d05b1 100644 --- a/.github/workflows/compressandrelease.yaml +++ b/.github/workflows/compressandrelease.yaml @@ -24,15 +24,26 @@ jobs: echo "${base}.zip" >> zipfiles.txt done - - name: Create Release and Upload Assets - run: | - files=$(tr '\n' ' ' < zipfiles.txt) - echo "files: $files" - echo "FILES=$files" >> $GITHUB_ENV - - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: ${{ env.FILES }} + - name: Create Release + id: create_release + uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} # This will be your-tag-name for a tag + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Assets + run: | + upload_url="${{ steps.create_release.outputs.upload_url }}" + for asset_path in $(cat zipfiles.txt); do + asset_name=$(basename $asset_path) + echo "Uploading $asset_path as $asset_name" + curl \ + --data-binary @"$asset_path" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: $(file -b --mime-type $asset_path)" \ + "$upload_url?name=$asset_name" + done \ No newline at end of file