name: Release on: push: tags: - v* branches: - 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 - os: windows-latest bin: sentrum.exe name: sentrum-${{ github.ref_name }}-windows-x86_64 - os: macos-latest bin: sentrum name: sentrum-${{ github.ref_name }}-darwin-x86_64 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: toolchain: stable - uses: Swatinem/rust-cache@v2 - run: cargo build --locked --release - name: Package shell: bash run: | strip target/release/${{ matrix.bin }} mkdir ${{ matrix.name }} cp target/release/${{ matrix.bin }} ${{ matrix.name }} cp sentrum.sample.toml ${{ matrix.name }} cp -r contrib ${{ matrix.name }} cp -r man ${{ matrix.name }} cp LICENSE.txt ${{ matrix.name }} if [[ "${{ matrix.os }}" == "windows-latest" ]] then 7z a ${{ matrix.name }}.zip ${{ matrix.name }} else tar czvf ${{ matrix.name }}.tar.gz ${{ matrix.name }} fi - name: Generate Changelog run: utils/generate_changelog.sh ${{ github.ref_name }} > ${{ github.workspace }}-CHANGELOG.md - name: Publish uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: body_path: ${{ github.workspace }}-CHANGELOG.md draft: true fail_on_unmatched_files: true files: sentrum-* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}