From 085692e24bd38ad18c888454b02fa09609b5fc1a Mon Sep 17 00:00:00 2001 From: Jan Baraniewski Date: Tue, 30 Apr 2024 01:48:15 +0200 Subject: [PATCH] Debug release assets even further --- .github/workflows/release.yml | 100 ++++++++++++++++------------------ 1 file changed, 46 insertions(+), 54 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5944b4f..26b382a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,61 +70,53 @@ jobs: name: ser2net2ser-${{ env.VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }} path: build/ser2net2ser-${{ env.VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }} - create-release: - needs: build-and-release - runs-on: ubuntu-latest - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - steps: - - uses: actions/checkout@v3 - - - name: Download all artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - - name: List all files in artifacts directory - run: ls -R artifacts - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref_name }} - draft: false - prerelease: false - - - name: debug - run: ls -la artifacts/ - - - name: Upload Release Assets - run: | - UPLOAD_URL="${{ steps.create_release.outputs.upload_url }}" - UPLOAD_URL="${UPLOAD_URL%\{*}" # Remove {?name,label} from URL - for file in /home/runner/work/ser2net2ser/ser2net2ser/artifacts/*; do - if [ -s "$file" ]; then # Check if file is not empty - FILE_NAME=$(basename "$file") - echo "Uploading $FILE_NAME" - echo 'curl -v -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: multipart/form-data" \ - -F "file=@$file;type=$(file -b --mime-type $file)" \ - -F "name=$FILE_NAME" \ - "${UPLOAD_URL}?name=$FILE_NAME"' - curl -v -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Content-Type: multipart/form-data" \ - -F "file=@$file;type=$(file -b --mime-type $file)" \ - -F "name=$FILE_NAME" \ - "${UPLOAD_URL}?name=$FILE_NAME" - else - echo "Skipping upload for empty file $file" - fi - done - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/ser2net2ser-${{ env.VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }} + asset_name: ser2net2ser-${{ env.VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }} + tag: ${{ github.ref }} + + + # create-release: + # needs: build-and-release + # runs-on: ubuntu-latest + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + # steps: + # - uses: actions/checkout@v3 + + # - name: Download all artifacts + # uses: actions/download-artifact@v3 + # with: + # path: artifacts + + # - name: List all files in artifacts directory + # run: ls -R artifacts + + # - name: Create Release + # id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # tag_name: ${{ github.ref }} + # release_name: Release ${{ github.ref_name }} + # draft: false + # prerelease: false + + # - name: debug + # run: ls -la artifacts/ + + # - name: Upload binaries to release + # uses: svenstaro/upload-release-action@v2 + # with: + # repo_token: ${{ secrets.GITHUB_TOKEN }} + # file: + # asset_name: mything + # tag: ${{ github.ref }} + # overwrite: true + # body: "This is my release text" container-image: