Skip to content

Add release action

Add release action #5

Workflow file for this run

name: Lint Build Deploy
on: push
env:
CARGO_TERM_COLOR: always
jobs:
test:
environment: Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint
run: cargo clippy --verbose
- name: Test
env:
TAXII_USERNAME: ${{ secrets.TAXII_USERNAME }}
TAXII_API_KEY: ${{ secrets.TAXII_API_KEY }}
run: cargo test --all-features --release --lib --tests --verbose
build:
environment: Testing
needs:
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --release --verbose
deploy:
if: startsWith(github.ref, 'refs/tags/')
environment: Deploy
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy
env:
CARGO_REGISTRY_TOKEN ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --verbose
release:
if: startsWith(github.ref, 'refs/tags/')
name: release ${{ matrix.target }}
needs: deploy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz tar.zst
- target: x86_64-apple-darwin
archive: zip
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}