chore: remove windows targets (#201) #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Draft Release | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
build-binaries: | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
# - x86_64-pc-windows-gnu | |
# - x86_64-apple-darwin | |
- aarch64-apple-darwin | |
name: | |
- commit-boost-cli | |
- commit-boost-pbs | |
- commit-boost-signer | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
# - target: x86_64-pc-windows-gnu | |
# os: windows-latest | |
# - target: x86_64-apple-darwin | |
# os: macos-latest | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: "stable" | |
- name: Cache Cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache Cargo index | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache Cargo build | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ matrix.name }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ matrix.name }}- | |
${{ runner.os }}-cargo-build-${{ matrix.target }}- | |
${{ runner.os }}-cargo-build- | |
- name: Install GNU toolchain (Windows) | |
if: matrix.target == 'x86_64-pc-windows-gnu' | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
install: mingw-w64-x86_64-gcc | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: ${{ matrix.target }} | |
- name: Build binary | |
run: cargo build --release --target ${{ matrix.target }} --bin ${{ matrix.name }} | |
env: | |
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: gcc | |
- name: Package binary (Unix) | |
if: runner.os != 'Windows' | |
run: | | |
cd target/${{ matrix.target }}/release | |
tar -czvf ${{ matrix.name }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ${{ matrix.name }} | |
mv ${{ matrix.name }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ../../../ | |
- name: Package binary (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
7z a ${{ matrix.name }}-${{ github.ref_name }}-${{ matrix.target }}.zip target\${{ matrix.target }}\release\${{ matrix.name }}.exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.name }}-${{ github.ref_name }}-${{ matrix.target }} | |
path: | | |
${{ matrix.name }}-${{ github.ref_name }}-${{ matrix.target }}.${{ runner.os == 'Windows' && 'zip' || 'tar.gz' }} | |
build-and-push-pbs-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: "stable" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push PBS Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
ghcr.io/commit-boost/pbs:${{ github.ref_name }} | |
ghcr.io/commit-boost/pbs:latest | |
cache-from: type=registry,ref=ghcr.io/commit-boost/pbs:buildcache | |
cache-to: type=registry,ref=ghcr.io/commit-boost/pbs:buildcache,mode=max | |
file: docker/pbs.Dockerfile | |
build-and-push-signer-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: "stable" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Signer Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
ghcr.io/commit-boost/signer:${{ github.ref_name }} | |
ghcr.io/commit-boost/signer:latest | |
cache-from: type=registry,ref=ghcr.io/commit-boost/signer:buildcache | |
cache-to: type=registry,ref=ghcr.io/commit-boost/signer:buildcache,mode=max | |
file: docker/signer.Dockerfile | |
finalize-release: | |
needs: | |
- build-binaries | |
- build-and-push-pbs-docker | |
- build-and-push-signer-docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ./artifacts | |
- name: Finalize Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./artifacts/**/* | |
draft: true | |
prerelease: false | |
tag_name: ${{ github.ref_name }} | |
name: ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |