fornet arm64 client build #6
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: fornet arm64 client build | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
description: "docker version to release" | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
docker-and-linux: | |
runs-on: macos-13-xlarge | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to GithubPackages | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: build and push docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
#platforms: linux/amd64,linux/arm64 | |
push: true | |
file: command/docker/client/client.Dockerfile | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ${{ env.REGISTRY }}/fornetcode/fornet:${{github.event.inputs.version}} | |
- name: copy binary from docker to release directory | |
run: | | |
mkdir -p release | |
docker run --rm -v ./release:/release ${{ env.REGISTRY }}/fornetcode/fornet:${{github.event.inputs.version}} cp /bin/fornet:/release/ && cp /bin/fornet-cli:/release | |
cd release && tar -czvf release/fornet-linux-aarch64.tar.gz ./fornet ./fornet-cli && rm fornet && rm fornet-cli | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: fornet-linux-aarch64.tar.gz | |
path: release/fornet-linux-aarch64.tar.gz | |
if-no-files-found: error | |
mac: | |
strategy: | |
max-parallel: 1 | |
fail-fast: true | |
matrix: | |
settings: | |
- host: macos-13-xlarge | |
target: aarch64-apple-darwin | |
build: make release-mac-aarch64 | |
runs-on: ${{ matrix.settings.host }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.settings.target }} | |
profile: minimal | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
client/target/ | |
key: ${{ matrix.settings.host }}-${{ matrix.settings.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ matrix.settings.host }}-cargo-${{ matrix.settings.target }} | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
- name: Build | |
run: ${{ matrix.settings.build }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: fornet-macos-aarch64 | |
path: release/* | |
if-no-files-found: error |