diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml new file mode 100644 index 0000000..b3a894d --- /dev/null +++ b/.github/workflows/build_release.yaml @@ -0,0 +1,59 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - os: ubuntu-20.04 + rust_target: x86_64-unknown-linux-gnu + ext: '' + args: '' + - os: macos-latest + rust_target: x86_64-apple-darwin + ext: '' + args: '' + - os: macos-latest + rust_target: aarch64-apple-darwin + ext: '' + args: '' + - os: windows-latest + rust_target: x86_64-pc-windows-msvc + ext: '.exe' + args: '' + - os: windows-latest + rust_target: aarch64-pc-windows-msvc + ext: '.exe' + args: '--no-default-features --features native-tls-vendored' + + steps: + - uses: actions/checkout@v4 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - run: cargo build --verbose + + - run: cargo test --verbose + + - run: cargo build --release + + - run: tar czvf commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz -C target/release commitlint${{ matrix.config.ext }} + + - uses: softprops/action-gh-release@v1 + with: + files: | + commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} +