Skip to content

Commit

Permalink
fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed Dec 4, 2024
1 parent f589c11 commit 1c6fded
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 25 deletions.
53 changes: 41 additions & 12 deletions .github/workflows/build_dev_exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ permissions:
contents: write

jobs:

check_release:
if: "contains(github.event.release.tag_name, '-dev')" # continue if the tag ends with -dev
if: "contains(github.event.release.tag_name, '-dev')" # continue if the tag ends with -dev
runs-on: ubuntu-latest
steps:
- name: Echo tag
Expand All @@ -24,11 +23,43 @@ jobs:
strategy:
matrix:
include:
- { runner: macos-latest, osname: macOS, arch: amd64, target: x86_64-apple-darwin, command: build }
- { runner: macos-latest, osname: macOS, arch: arm64, target: aarch64-apple-darwin, command: build }
- { runner: ubuntu-latest, osname: linux, arch: amd64, target: x86_64-unknown-linux-gnu, command: build }
- { runner: ubuntu-latest, osname: linux, arch: arm64, target: aarch64-unknown-linux-gnu, command: build, build_args: --no-default-features }
- { runner: windows-latest, osname: windows, arch: amd64, target: x86_64-pc-windows-msvc, command: build, extension: ".exe" }
- {
runner: macos-latest,
osname: macOS,
arch: amd64,
target: x86_64-apple-darwin,
command: build,
}
- {
runner: macos-latest,
osname: macOS,
arch: arm64,
target: aarch64-apple-darwin,
command: build,
}
- {
runner: ubuntu-latest,
osname: linux,
arch: amd64,
target: x86_64-unknown-linux-gnu,
command: build,
}
- {
runner: ubuntu-latest,
osname: linux,
arch: arm64,
target: aarch64-unknown-linux-gnu,
command: build,
build_args: --no-default-features,
}
- {
runner: windows-latest,
osname: windows,
arch: amd64,
target: x86_64-pc-windows-msvc,
command: build,
extension: ".exe",
}
# - { runner: windows-latest, osname: windows, arch: arm64, target: aarch64-pc-windows-msvc, command: build, extension: ".exe", toolchain: nightly }

steps:
Expand All @@ -44,31 +75,29 @@ jobs:
with:
command: ${{ matrix.command }}
target: ${{ matrix.target }}
args: "--locked --release ${{ matrix.build_args }}"
args: "--bin dkn-compute --locked --release ${{ matrix.build_args }}"
strip: true

- name: Prepare Release File
run: |
# move the binary
mv target/${{ matrix.target }}/release/dkn-compute${{ matrix.extension }} ./dkn-compute-binary-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}
- name: Upload Launch Artifacts
uses: actions/upload-artifact@v4
with:
name: dkn-compute-binary-${{ matrix.osname }}-${{ matrix.arch }}
path: dkn-compute-binary-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}


release:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all tags and history
fetch-depth: 0 # Fetch all tags and history

- name: Download Launch Artifacts
uses: actions/download-artifact@v4
Expand Down
53 changes: 41 additions & 12 deletions .github/workflows/build_prod_exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ permissions:
contents: write

jobs:

check_release:
if: "! contains(github.event.release.tag_name, '-dev')" # skip if the tag ends with -dev
if: "! contains(github.event.release.tag_name, '-dev')" # skip if the tag ends with -dev
runs-on: ubuntu-latest
steps:
- name: Echo tag
Expand All @@ -24,11 +23,43 @@ jobs:
strategy:
matrix:
include:
- { runner: macos-latest, osname: macOS, arch: amd64, target: x86_64-apple-darwin, command: build }
- { runner: macos-latest, osname: macOS, arch: arm64, target: aarch64-apple-darwin, command: build }
- { runner: ubuntu-latest, osname: linux, arch: amd64, target: x86_64-unknown-linux-musl, command: build }
- { runner: ubuntu-latest, osname: linux, arch: arm64, target: aarch64-unknown-linux-musl, command: build, build_args: --no-default-features }
- { runner: windows-latest, osname: windows, arch: amd64, target: x86_64-pc-windows-msvc, command: build, extension: ".exe" }
- {
runner: macos-latest,
osname: macOS,
arch: amd64,
target: x86_64-apple-darwin,
command: build,
}
- {
runner: macos-latest,
osname: macOS,
arch: arm64,
target: aarch64-apple-darwin,
command: build,
}
- {
runner: ubuntu-latest,
osname: linux,
arch: amd64,
target: x86_64-unknown-linux-musl,
command: build,
}
- {
runner: ubuntu-latest,
osname: linux,
arch: arm64,
target: aarch64-unknown-linux-musl,
command: build,
build_args: --no-default-features,
}
- {
runner: windows-latest,
osname: windows,
arch: amd64,
target: x86_64-pc-windows-msvc,
command: build,
extension: ".exe",
}
# - { runner: windows-latest, osname: windows, arch: arm64, target: aarch64-pc-windows-msvc, command: build, extension: ".exe", toolchain: nightly }

steps:
Expand All @@ -44,31 +75,29 @@ jobs:
with:
command: ${{ matrix.command }}
target: ${{ matrix.target }}
args: "--locked --release ${{ matrix.build_args }}"
args: "--bin dkn-compute --locked --release ${{ matrix.build_args }}"
strip: true

- name: Prepare Release File
run: |
# move the binary
mv target/${{ matrix.target }}/release/dkn-compute${{ matrix.extension }} ./dkn-compute-binary-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}
- name: Upload Launch Artifacts
uses: actions/upload-artifact@v4
with:
name: dkn-compute-binary-${{ matrix.osname }}-${{ matrix.arch }}
path: dkn-compute-binary-${{ matrix.osname }}-${{ matrix.arch }}${{ matrix.extension }}


release:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all tags and history
fetch-depth: 0 # Fetch all tags and history

- name: Download Launch Artifacts
uses: actions/download-artifact@v4
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
resolver = "2"
members = ["compute", "p2p", "workflows", "utils", "monitor"]

# compute node is the default member, until Oracle comes in
# then, a Launcher will be the default member
default-members = ["compute"]

[workspace.package]
edition = "2021"
version = "0.2.26"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN echo "Target platform: $TARGETPLATFORM"
# build release binary
WORKDIR /usr/src/app
COPY . .
RUN cargo build --release
RUN cargo build --bin dkn-compute --release

# copy release binary to distroless
FROM --platform=$BUILDPLATFORM gcr.io/distroless/cc
Expand Down

0 comments on commit 1c6fded

Please sign in to comment.