minify-html/.github/workflows/cli.yml

50 lines
1.5 KiB
YAML
Raw Normal View History

name: Build and upload CLI
on:
create:
tags:
- 'v*'
jobs:
cli:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
ARCH: linux-x86_64
MIME: application/octet-stream
EXT: ''
- os: windows-latest
ARCH: windows-x86_64
MIME: application/vnd.microsoft.portable-executable
EXT: '.exe'
- os: macos-latest
ARCH: macos-x86_64
MIME: application/octet-stream
EXT: ''
steps:
- uses: actions/checkout@v1
- name: Get version
id: version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Get file name
id: file
run: echo ::set-output name=FILE::${{ steps.version.outputs.VERSION }}-${{ matrix.ARCH }}${{ matrix.EXT }}
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Build CLI
run: cargo build --release
- uses: chrislennon/action-aws-cli@v1.1
- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-west-2
2020-01-01 05:08:12 -05:00
run: aws s3 cp ./target/release/hyperbuild${{ matrix.EXT }} s3://${{ secrets.AWS_S3_BUCKET }}/hyperbuild/bin/${{ steps.file.outputs.FILE }} --content-type ${{ matrix.MIME }}