name: Release on: push: tags: - "*" jobs: build: name: Build runs-on: ${{ matrix.os }} strategy: matrix: os: [macOS-latest, windows-latest, ubuntu-latest] include: - os: macOS-latest archive: tar output: streamlib-${{ github.sha }}-x86_64-apple-darwin.tar.gz content_type: 'application/gzip' - os: windows-latest archive: zip output: streamlib-${{ github.sha }}-x86_64-pc-windows-msvc.zip content_type: application/zip - os: ubuntu-latest archive: tar output: streamlib-${{ github.sha }}-x86_64-unknown-linux-gnu.tar.gz content_type: application/gzip steps: - name: Checkout uses: actions/checkout@v1 - name: Install toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable - name: Build run: cargo build --verbose --release - name: Test run: cargo test --verbose - name: Build ZIP id: build_zip if: matrix.archive == 'zip' run: | cp target/release/foo.exe . 7z a ${{ matrix.output }} foo.exe - name: Build TAR id: build_tar if: matrix.archive == 'tar' run: | cp target/release/foo . tar czvf ${{ matrix.output }} foo - name: Upload uses: actions/upload-artifact@master with: name: ${{ matrix.output }} path: ${{ matrix.output }}