diff options
author | Batuhan Taskaya <isidentical@gmail.com> | 2022-05-06 15:40:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 15:40:14 +0300 |
commit | 11b2af0f5976d157511ae10b09413468524b44d0 (patch) | |
tree | 9aac580cbfd89e6b80e25afd5485ef3f27bda137 | |
parent | b54239b5251e3a6988fd6c458efe063f001800f8 (diff) |
Automatically attach debian packages and linux binaries to the release (#1390)
* Automatically attach debian packages and linux binaries to the release
* Use set-output syntax
-rw-r--r-- | .github/workflows/release-linux-standalone.yml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/.github/workflows/release-linux-standalone.yml b/.github/workflows/release-linux-standalone.yml index 967987d9..33fa2131 100644 --- a/.github/workflows/release-linux-standalone.yml +++ b/.github/workflows/release-linux-standalone.yml @@ -7,6 +7,9 @@ on: description: "The branch, tag or SHA to release from" required: true default: "master" + tag_name: + description: "Which release to upload the artifacts to (i.e., 3.0)" + required: true release: types: [released, prereleased] @@ -45,24 +48,30 @@ jobs: name: httpie.rpm path: extras/packaging/linux/artifacts/dist/*.rpm + - name: Determine the release upload upload_url + id: release_id + run: | + pip install httpie + export API_URL="api.github.com/repos/httpie/httpie/releases/tags/${{ github.event.inputs.tag_name }}" + export UPLOAD_URL=`https --ignore-stdin GET $API_URL | jq -r ".upload_url"` + echo "::set-output name=UPLOAD_URL::$UPLOAD_URL" + - name: Publish Debian Package - if: github.event_name == 'release' uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: extras/packaging/linux/artifacts/dist/httpie-${{ github.event.release.tag_name }}.deb - asset_name: httpie-${{ github.event.release.tag_name }}.deb + upload_url: ${{ steps.release_id.outputs.UPLOAD_URL }} + asset_path: extras/packaging/linux/artifacts/dist/httpie_${{ github.event.inputs.tag_name }}_amd64.deb + asset_name: httpie-${{ github.event.inputs.tag_name }}.deb asset_content_type: binary/octet-stream - name: Publish Single Executable - if: github.event_name == 'release' uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ github.event.release.upload_url }} + upload_url: ${{ steps.release_id.outputs.UPLOAD_URL }} asset_path: extras/packaging/linux/artifacts/dist/http asset_name: http asset_content_type: binary/octet-stream |