name: Release on: push: tags: - v* jobs: release: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] include: - os: ubuntu-latest bin: sentrum name: sentrum-${{ github.ref_name }}-linux-x86_64.tar.gz - os: windows-latest bin: sentrum.exe name: sentrum-${{ github.ref_name }}-windows-x86_64.zip - os: macos-latest bin: sentrum name: sentrum-${{ github.ref_name }}--darwin-x86_64.tar.gz runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: toolchain: stable - uses: Swatinem/rust-cache@v2 - run: cargo build --release - name: Package shell: bash run: | strip target/release/${{ matrix.bin }} cd target/release if [[ "${{ matrix.os }}" == "windows-latest" ]] then 7z a ../../${{ matrix.name }} ${{ matrix.bin }} else tar czvf ../../${{ matrix.name }} ${{ matrix.bin }} fi cd - - name: Publish uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: draft: true files: | sentrum-* sentrum.sample.toml contrib/sentrum.service env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}