Skip to content

Commit

Permalink
fix(pipeline): Fix release asset upload
Browse files Browse the repository at this point in the history
  • Loading branch information
RouHim committed Jan 19, 2023
1 parent 7652ca7 commit b86ca0a
Showing 1 changed file with 44 additions and 38 deletions.
82 changes: 44 additions & 38 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -293,51 +293,57 @@ jobs:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: npx semantic-release

- name: Get release
id: get_release
uses: bruceadams/[email protected]
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:
Expand Down

0 comments on commit b86ca0a

Please sign in to comment.