2021-02-23 04:25:39 +00:00
|
|
|
name: "Release swap_cli"
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Release swap_cli
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- target: x86_64-unknown-linux-gnu
|
|
|
|
os: ubuntu-latest
|
|
|
|
- target: x86_64-apple-darwin
|
|
|
|
os: macos-latest
|
2021-03-02 00:12:01 +00:00
|
|
|
- target: x86_64-pc-windows-msvc
|
|
|
|
os: windows-latest
|
2021-02-23 04:25:39 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout tagged commit
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.release.target_commitish }}
|
|
|
|
token: ${{ secrets.BOTTY_GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build ${{ matrix.target }} release binary
|
|
|
|
run: cargo build --target=${{ matrix.target }} --release --package swap --bin swap_cli
|
|
|
|
|
2021-03-01 23:33:44 +00:00
|
|
|
- name: Smoke test the binary
|
|
|
|
run: target/${{ matrix.target }}/release/swap_cli --help
|
|
|
|
|
2021-02-23 04:25:39 +00:00
|
|
|
# Remove once python 3 is the default
|
|
|
|
- uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
|
|
|
|
- name: Create release archive
|
|
|
|
id: create-archive
|
|
|
|
uses: ./.github/actions/create-release-archive
|
|
|
|
with:
|
|
|
|
binary: swap_cli
|
|
|
|
version: ${{ github.event.release.tag_name }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
|
|
|
|
- name: Upload ${{ matrix.os }} release binary
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
|
|
asset_path: ./${{ steps.create-archive.outputs.archive }}
|
|
|
|
asset_name: ${{ steps.create-archive.outputs.archive }}
|
2021-02-26 07:11:18 +00:00
|
|
|
asset_content_type: application/gzip
|