diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 84ee1c6..400138d 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -293,51 +293,57 @@ jobs: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: npx semantic-release - - name: Get release - id: get_release - uses: bruceadams/get-release@v1.3.2 - env: - GITHUB_TOKEN: ${{ github.token }} - - name: Upload the x86 built binaries to the release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./target/x86_64-unknown-linux-musl/release/this-week-in-past - asset_name: this-week-in-past-x86_64-unknown-linux-musl - asset_content_type: application/x-executable + run: | + ASSETS_URL=$(curl -s https://api.github.com/repos/RouHim/this-week-in-past/releases/latest | jq '.assets_url') + NAME=this-week-in-past-x86_64-unknown-linux-musl + PATH=./target/x86_64-unknown-linux-musl/release/this-week-in-past + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + --data-binary "@${PATH}" \ + ${ASSETS_URL}?name=${NAME} - name: Upload the aarch64 built binaries to the release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./target/aarch64-unknown-linux-musl/release/this-week-in-past - asset_name: this-week-in-past-aarch64-unknown-linux-musl - asset_content_type: application/x-executable + run: | + ASSETS_URL=$(curl -s https://api.github.com/repos/RouHim/this-week-in-past/releases/latest | jq '.assets_url') + NAME=this-week-in-past-aarch64-unknown-linux-musl + PATH=./target/aarch64-unknown-linux-musl/release/this-week-in-past + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + --data-binary "@${PATH}" \ + ${ASSETS_URL}?name=${NAME} - name: Upload the armv7 built binaries to the release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./target/armv7-unknown-linux-musleabihf/release/this-week-in-past - asset_name: this-week-in-past-armv7-unknown-linux-musleabihf - asset_content_type: application/x-executable + run: | + ASSETS_URL=$(curl -s https://api.github.com/repos/RouHim/this-week-in-past/releases/latest | jq '.assets_url') + NAME=this-week-in-past-armv7-unknown-linux-musleabihf + PATH=./target/armv7-unknown-linux-musleabihf/release/this-week-in-past + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + --data-binary "@${PATH}" \ + ${ASSETS_URL}?name=${NAME} - name: Upload the arm v6 built binaries to the release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./target/arm-unknown-linux-musleabihf/release/this-week-in-past - asset_name: this-week-in-past-arm-unknown-linux-musleabihf - asset_content_type: application/x-executable + run: | + ASSETS_URL=$(curl -s https://api.github.com/repos/RouHim/this-week-in-past/releases/latest | jq '.assets_url') + NAME=this-week-in-past-arm-unknown-linux-musleabihf + PATH=./target/arm-unknown-linux-musleabihf/release/this-week-in-past + curl \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\ + -H "X-GitHub-Api-Version: 2022-11-28" \ + --data-binary "@${PATH}" \ + ${ASSETS_URL}?name=${NAME} publish-container-images: