-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (93 loc) · 2.98 KB
/
release2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: "Release Cross"
on:
workflow_dispatch:
inputs:
tag:
description: 'The release tag. Must follow Rust versioning conventions, e.g. "0.0.0"'
required: true
env:
CRATE_NAME: mamorurs-cli
GITHUB_TOKEN: ${{ github.token }}
RUST_BACKTRACE: 1
CARGO_NET_GIT_FETCH_WITH_CLI: true
permissions:
contents: write
jobs:
build:
name: Release - ${{ matrix.platform.release_for }}
strategy:
matrix:
platform:
- release_for: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bin: mamorurs-cli
name: mamorurs-cli-linux-x86_64.zip
- release_for: macOS-x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: mamorurs-cli
name: mamorurs-cli-darwin-x86_64.zip
- release_for: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin: mamorurs-cli
name: mamorurs-cli-darwin-aarch64.zip
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.MAMORU_CORE_KEY }}
${{ secrets.VALIDATION_CHAIN_KEY }}
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "23.x"
- uses: Swatinem/rust-cache@v2
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
- name: Upload release binaries
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.name }}
path: |
./target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
release:
name: Release Binaries
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: |
./release-binaries/
- name: Display structure of downloaded files
run: ls -lh ./release-binaries/*
# - name: Upload release binaries to GitHub Release
# uses: ncipollo/release-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ github.event.inputs.tag }}
# name: Release ${{ github.event.inputs.tag }}
# artifacts: "./release-binaries/mamorurs-cli-*"
- name: release
uses: softprops/action-gh-release@v2
with:
files: "./release-binaries/*.zip"
draft: false
prerelease: false
tag_name: ${{ github.event.inputs.tag }}
body: "Release ${{ github.event.inputs.tag }}"
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true