Skip to content

Commit

Permalink
chore: add publish-linux-assets job to cd workflow (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
poppoerika authored Apr 14, 2022
1 parent e0f6d47 commit 5f4fd1b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,36 @@ jobs:
id: release
run: echo "::set-output name=release::${{ steps.semrel.outputs.version }}"

publish-linux-assets:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_x86_64
needs: release
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true

- name: Build tar.gz and publish asset
run: |
VERSION=${{ needs.release.outputs.version }}
BINARY_FILE=momento-cli-$VERSION.x86_64_linux.tar.gz
BINARY_DIR=momento-cli
mkdir $BINARY_DIR
cargo build --release
mv ./target/release/momento $BINARY_DIR
tar zcvf $BINARY_FILE $BINARY_DIR
AUTH="Authorization: token ${{ secrets.PRIVATE_REPO_RELEASE_ACCESS }}"
LATEST_RELEASE=$(curl -sH "$AUTH" https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/v${VERSION})
RELEASE_ID=$(echo $LATEST_RELEASE | jq -r .id)
GH_ASSET="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${BINARY_FILE}"
echo $GH_ASSET
curl --data-binary @$BINARY_FILE -H "$AUTH" -H "Content-Type: application/octet-stream" $GH_ASSET
shell: bash

update-cargo:
runs-on: ubuntu-latest
needs: release
Expand Down

0 comments on commit 5f4fd1b

Please sign in to comment.