This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release | |
on: [push] | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
# Use a container with GLIBC 2.17 | |
container: quay.io/pypa/manylinux2014_x86_64 | |
steps: | |
- name: Show GLIBC | |
run: ldd --version | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
with: | |
ref: ${{ github.event.inputs.sha || env.GITHUB_SHA }} | |
- name: Set env on push | |
if: github.event_name == 'push' | |
run: | | |
echo "INPUT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
echo "INPUT_TAG=$(git tag --points-at HEAD)" >> $GITHUB_ENV | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: Swatinem/rust-cache@v1 | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- name: Prepare archive | |
run: | | |
strip target/release/restop | |
export ARCHIVE_NAME=restop-${{ env.INPUT_TAG }}-linux-x64.tar.gz | |
echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV | |
tar -czvf $ARCHIVE_NAME -C target/release restop | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.INPUT_TAG }} | |
release_name: ${{ env.INPUT_TAG }} | |
body: HQ ${{ env.INPUT_TAG }} | |
commitish: ${{ env.INPUT_SHA }} | |
draft: false | |
prerelease: false | |
- name: Upload scheduler binary | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.ARCHIVE_NAME }} | |
asset_name: ${{ env.ARCHIVE_NAME }} | |
asset_content_type: application/tar+gzip |