Skip to content

Commit 30acf35

Browse files
committed
👷 re-enable cargo make for release
1 parent ab7e1ff commit 30acf35

1 file changed

Lines changed: 51 additions & 39 deletions

File tree

.github/workflows/release.yaml

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,61 @@ permissions:
1313
contents: write
1414

1515
jobs:
16-
create-release:
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: actions/checkout@v3
20-
- uses: taiki-e/create-gh-release-action@v1
21-
with:
22-
# (optional) Path to changelog.
23-
changelog: CHANGELOG.md
24-
# (required) GitHub token for creating GitHub Releases.
25-
token: ${{ secrets.GITHUB_TOKEN }}
26-
27-
upload-assets:
16+
build:
17+
runs-on: ${{ matrix.os.imageName }}
2818
strategy:
2919
matrix:
30-
include:
20+
rust_toolchain: ["stable"]
21+
os:
3122
- target_platform: x86_64-unknown-linux-gnu
32-
os: ubuntu-latest
23+
imageName: ubuntu-latest
24+
cross: "true"
3325
- target_platform: x86_64-unknown-linux-musl
34-
os: ubuntu-latest
35-
- target: aarch64-unknown-linux-musl
36-
os: ubuntu-latest
37-
- target: aarch64-apple-darwin
38-
os: macos-latest
39-
- target: x86_64-apple-darwin
40-
os: macos-latest
41-
# Universal macOS binary is supported as universal-apple-darwin.
42-
- target: universal-apple-darwin
43-
os: macos-latest
44-
- target: x86_64-pc-windows-msvc
45-
os: windows-latest
46-
runs-on: ${{ matrix.os }}
26+
imageName: ubuntu-latest
27+
cross: "true"
28+
- target_platform: aarch64-unknown-linux-musl
29+
imageName: ubuntu-latest
30+
cross: "true"
31+
- target_platform: x86_64-apple-darwin
32+
imageName: "macOS-latest"
33+
- target_platform: aarch64-apple-darwin
34+
imageName: "macOS-latest"
35+
- target_platform: x86_64-pc-windows-msvc
36+
imageName: windows-latest
37+
4738
steps:
4839
- uses: actions/checkout@v3
49-
- uses: taiki-e/upload-rust-binary-action@v1
40+
- uses: actions/cache@v3
41+
with:
42+
path: |
43+
~/.cargo/bin/
44+
~/.cargo/registry/index/
45+
~/.cargo/registry/cache/
46+
~/.cargo/git/db/
47+
target/
48+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
49+
- uses: actions-rs/toolchain@v1
50+
with:
51+
toolchain: ${{ matrix.rust_toolchain }}
52+
target: ${{ matrix.os.target_platform }}
53+
override: true
54+
profile: minimal
55+
- uses: davidB/rust-cargo-make@v1
56+
- name: Make zip-release-ci-flow
57+
id: zip-release-ci-flow
58+
run: cargo make --disable-check-for-updates zip-release-ci-flow
59+
env:
60+
TARGET: ${{ matrix.os.target_platform }}
61+
CROSS: ${{ matrix.os.cross }}
62+
# DEVELOPER_DIR: "/Applications/Xcode_11.app/Contents/Developer"
63+
- name: Upload binaries to release
64+
# if: startsWith(github.ref, 'refs/tags/')
65+
uses: svenstaro/upload-release-action@v2
5066
with:
51-
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
52-
# Note that glob pattern is not supported yet.
53-
bin: kubectl-view-allocations
54-
features: cli
55-
# (optional) Comma-separated list of additional files to be included to archive.
56-
# Note that glob pattern is not supported yet.
57-
include: LICENSE.txt
58-
# (optional) Target triple, default is host triple.
59-
target: ${{ matrix.target }}
60-
# (required) GitHub token for uploading assets to GitHub Releases.
61-
token: ${{ secrets.GITHUB_TOKEN }}
67+
repo_token: ${{ secrets.GITHUB_TOKEN }}
68+
file: ${{ steps.zip-release-ci-flow.outputs.dist_file_path }}
69+
# asset_name: ${{ steps.zip-release-ci-flow.outputs.dist_file_name }}
70+
# tag: ${{ github.ref }}
71+
tag: ${{ steps.zip-release-ci-flow.outputs.dist_version }}
72+
prerelease: ${{ github.ref == format('refs/tags/{0}', steps.zip-release-ci-flow.outputs.dist_version) }}
73+
overwrite: true

0 commit comments

Comments
 (0)