Skip to content

Commit

Permalink
fix(release): replace release upload action (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoceppi authored Mar 15, 2023
1 parent 49c7817 commit e5ae2d2
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
tag: ${{ steps.release-please.outputs.tag_name }}
upload_url: ${{ steps.release-please.outputs.upload_url }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
Expand Down Expand Up @@ -49,9 +50,18 @@ jobs:
with:
spec_file: "pkg/rpm.spec"
- name: Upload release binaries
uses: ublue-os/upload-assets@pass-in-tag
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./${{ steps.rpm_build.outputs.source_rpm_path }}*", "./${{ steps.rpm_build.outputs.rpm_dir_path }}noarch/*"]'
tag: ${{ needs.release-please.outputs.tag }}
run: |
AUTH_HEADER="Authorization: token ${{ github.token }}"
for f in $(ls ${{ steps.rpm_build.outputs.rpm_dir_path }}noarch/); do
fpath="${{ steps.rpm_build.outputs.rpm_dir_path }}noarch/$f"
echo $fpath
CONTENT_LENGTH_HEADER="Content-Length: $(stat -c%s "${fpath}")"
CONTENT_TYPE_HEADER="Content-Type: application/octet-stream"
curl -f -sSL -XPOST \
-H "${AUTH_HEADER}" \
-H "${CONTENT_LENGTH_HEADER}" \
-H "${CONTENT_TYPE_HEADER}" \
--upload-file "${fpath}" \
"${{ needs.release-please.outputs.upload_url }}?name=${f}"
done

0 comments on commit e5ae2d2

Please sign in to comment.