build on ubuntu 20.04 #43
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: Build and Publish Compute Releases | |
on: | |
push: | |
branches: | |
- build-ubuntu-20-04 | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ${{ matrix.runner }} | |
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-20.04, osname: linux, arch: amd64, target: x86_64-unknown-linux-gnu, command: build } | |
- { runner: ubuntu-20.04, 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: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Build binary | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: ${{ matrix.command }} | |
target: ${{ matrix.target }} | |
args: "--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 | |
- name: Download Launch Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: ./artifacts | |
- name: Get the latest tag | |
id: get_latest_tag | |
run: | | |
# latest release tag | |
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null || echo "untagged") | |
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV | |
# latest release name | |
LATEST_RELEASE=$(curl -s \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.name // "no-release-found"') | |
echo "LATEST_RELEASE=$LATEST_RELEASE" >> $GITHUB_ENV | |
echo "Latest Tag: $LATEST_TAG" | |
echo "Latest Release: $LATEST_RELEASE" | |
- name: Create release with artifacts | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ env.LATEST_RELEASE }} | |
tag: ${{ env.LATEST_TAG }} | |
artifacts: "artifacts/*" | |
artifactContentType: application/octet-stream | |
allowUpdates: true | |
# draft: true |