update dependencies #48
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*.*.*' | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build rust ${{ matrix.platform.target }}/${{ matrix.platform.os }} | |
runs-on: ${{ matrix.platform.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
# mac target | |
- { os: 'macos-latest', target: 'x86_64-apple-darwin', arch: 'x86_64', osn: 'mac', tests_integration: true } | |
- { os: 'macos-latest', target: 'aarch64-apple-darwin', arch: 'aarch64', osn: 'mac', tests_integration: false } | |
# linux target | |
- { os: 'ubuntu-latest', target: 'x86_64-unknown-linux-musl', arch: 'x86_64', osn: 'ubuntu-latest', tests_integration: true } | |
- { os: 'ubuntu-latest', target: 'aarch64-unknown-linux-musl', arch: 'aarch64', osn: 'ubuntu-latest', tests_integration: true } | |
steps: | |
- name: Set output | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.platform.target }} | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: test | |
args: --target ${{ matrix.platform.target }} --bin vault | |
if: "matrix.platform.tests_integration == true" | |
- uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --release --target ${{ matrix.platform.target }} --bin vault | |
- name: mv artifacts | |
run: | | |
mkdir -p artifact | |
cp target/${{ matrix.platform.target }}/release/vault artifact/vault-${{ env.RELEASE_VERSION }}-${{ matrix.platform.target }} | |
cp target/${{ matrix.platform.target }}/release/vault artifact/vault_${{ matrix.platform.osn }}_${{ matrix.platform.arch }} | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: Prepare output artifact for next step | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vault-${{ env.RELEASE_VERSION }}-${{ matrix.platform.target }} | |
path: artifact/vault-${{ env.RELEASE_VERSION }}-${{ matrix.platform.target }} | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: Prepare output artifact for next step | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vault_${{ matrix.platform.osn }}_${{ matrix.platform.arch }} | |
path: artifact/vault_${{ matrix.platform.osn }}_${{ matrix.platform.arch }} | |
if: startsWith(github.ref, 'refs/tags/') | |
release: | |
runs-on: 'ubuntu-latest' | |
needs: [ "build" ] | |
steps: | |
- name: download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: binaries | |
- name: install packages | |
run: | | |
ls . | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
fail_on_unmatched_files: true | |
files: | | |
binaries/*/* |