Skip to content

Commit

Permalink
👷 re-enable cargo make for release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidB committed Apr 2, 2023
1 parent ab7e1ff commit 30acf35
Showing 1 changed file with 51 additions and 39 deletions.
90 changes: 51 additions & 39 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,61 @@ permissions:
contents: write

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: taiki-e/create-gh-release-action@v1
with:
# (optional) Path to changelog.
changelog: CHANGELOG.md
# (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
build:
runs-on: ${{ matrix.os.imageName }}
strategy:
matrix:
include:
rust_toolchain: ["stable"]
os:
- target_platform: x86_64-unknown-linux-gnu
os: ubuntu-latest
imageName: ubuntu-latest
cross: "true"
- target_platform: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
# Universal macOS binary is supported as universal-apple-darwin.
- target: universal-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
imageName: ubuntu-latest
cross: "true"
- target_platform: aarch64-unknown-linux-musl
imageName: ubuntu-latest
cross: "true"
- target_platform: x86_64-apple-darwin
imageName: "macOS-latest"
- target_platform: aarch64-apple-darwin
imageName: "macOS-latest"
- target_platform: x86_64-pc-windows-msvc
imageName: windows-latest

steps:
- uses: actions/checkout@v3
- uses: taiki-e/upload-rust-binary-action@v1
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust_toolchain }}
target: ${{ matrix.os.target_platform }}
override: true
profile: minimal
- uses: davidB/rust-cargo-make@v1
- name: Make zip-release-ci-flow
id: zip-release-ci-flow
run: cargo make --disable-check-for-updates zip-release-ci-flow
env:
TARGET: ${{ matrix.os.target_platform }}
CROSS: ${{ matrix.os.cross }}
# DEVELOPER_DIR: "/Applications/Xcode_11.app/Contents/Developer"
- name: Upload binaries to release
# if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: kubectl-view-allocations
features: cli
# (optional) Comma-separated list of additional files to be included to archive.
# Note that glob pattern is not supported yet.
include: LICENSE.txt
# (optional) Target triple, default is host triple.
target: ${{ matrix.target }}
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.zip-release-ci-flow.outputs.dist_file_path }}
# asset_name: ${{ steps.zip-release-ci-flow.outputs.dist_file_name }}
# tag: ${{ github.ref }}
tag: ${{ steps.zip-release-ci-flow.outputs.dist_version }}
prerelease: ${{ github.ref == format('refs/tags/{0}', steps.zip-release-ci-flow.outputs.dist_version) }}
overwrite: true

0 comments on commit 30acf35

Please sign in to comment.