Skip to content

Merge pull request #76 from bacpop/cov_fix #31

Merge pull request #76 from bacpop/cov_fix

Merge pull request #76 from bacpop/cov_fix #31

Workflow file for this run

name: Make release
on:
push:
tags:
- "v*.*.*"
branches:
- release_testing
env:
CARGO_TERM_COLOR: always
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
jobs:
build-binaries:
runs-on: ${{ matrix.config.os }}
name: Release ${{ matrix.config.os }} (${{ matrix.config.toolchain }})
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, toolchain: 'stable'}
- {os: ubuntu-latest, toolchain: 'stable'}
steps:
- uses: actions/checkout@v3
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.config.toolchain }}
override: true
# NB see https://github.com/actions-rs/cargo if we ever want to try cross
# e.g. for Mac M1/arm64
- name: Build and package binary
shell: bash
run: |
cargo install --path .
cp $HOME/.cargo/bin/ska .
tar czvf ska-${{ github.ref_name }}-${{ matrix.config.os }}-${{ matrix.config.toolchain }}.tar.gz ska LICENSE NOTICE README.md
- name: Upload package
if: success()
uses: actions/upload-artifact@v3
with:
name: ska-${{ github.ref_name }}-${{ matrix.config.os }}-${{ matrix.config.toolchain }}
path: ska-${{ github.ref_name }}-${{ matrix.config.os }}-${{ matrix.config.toolchain }}.tar.gz
create-release:
runs-on: ubuntu-latest
needs: build-binaries
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: build
- name: Organise files
shell: bash
run: |
cp build/ska-${{ github.ref_name }}-macOS-latest-stable/ska-${{ github.ref_name }}-macOS-latest-stable.tar.gz .
cp build/ska-${{ github.ref_name }}-ubuntu-latest-stable/ska-${{ github.ref_name }}-ubuntu-latest-stable.tar.gz .
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
fail_on_unmatched_files: true
generate_release_notes: true
files: |
ska-*.tar.gz
push_crate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v1
if: startsWith(github.ref, 'refs/tags/')
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}