-
Notifications
You must be signed in to change notification settings - Fork 3
165 lines (139 loc) · 4.33 KB
/
stable-binarys.yaml
File metadata and controls
165 lines (139 loc) · 4.33 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Release Stable Binary's
on:
workflow_dispatch:
permissions:
contents: write
packages: write
env:
CARGO_TERM_COLOR: always
jobs:
app_version:
name: Get App Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from Cargo.toml
id: get_version
run: |
version=$(grep '^version' Cargo.toml | head -n1 | sed -E 's/version = "(.*)"/\1/')
echo "version=$version" >> $GITHUB_OUTPUT
linux_amd64_binary:
name: Prepare Linux AMD64 Binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Docker DinD
uses: docker/setup-buildx-action@v3
- name: Install Rust Cross Lib
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: Build with Cross
run: |
cross build --target x86_64-unknown-linux-gnu --release -p phlow-runtime
- name: Upload Linux binary artifact
uses: actions/upload-artifact@v4
with:
name: phlow-binary-linux-amd64
path: ./target/x86_64-unknown-linux-gnu/release/phlow
linux_arm64_binary:
name: Prepare Linux ARM64 Binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Docker DinD
uses: docker/setup-buildx-action@v3
- name: Install Rust Cross Lib
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: Build with Cross
run: |
cross build --target aarch64-unknown-linux-gnu --release -p phlow-runtime
- name: Upload Linux binary artifact
uses: actions/upload-artifact@v4
with:
name: phlow-binary-linux-arm64
path: ./target/aarch64-unknown-linux-gnu/release/phlow
build_macos:
name: Build Binary for macOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build with Cargo
run: cargo build --release
- name: Upload macOS binary
uses: actions/upload-artifact@v4
with:
name: phlow-binary-macos
path: target/release/phlow
tag:
name: Tag Release
runs-on: ubuntu-latest
needs:
- app_version
- linux_amd64_binary
- linux_arm64_binary
- build_macos
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Git Tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git fetch --tags
git tag "v${{ needs.app_version.outputs.version }}"
git push origin "v${{ needs.app_version.outputs.version }}"
github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs:
- app_version
- linux_amd64_binary
- linux_arm64_binary
- build_macos
- tag
steps:
- name: Download Linux binary
uses: actions/download-artifact@v4
with:
name: phlow-binary-linux-amd64
path: ./linux-amd64
- name: Download Linux binary
uses: actions/download-artifact@v4
with:
name: phlow-binary-linux-arm64
path: ./linux-arm64
- name: Download macOS binary
uses: actions/download-artifact@v4
with:
name: phlow-binary-macos
path: ./macos
- name: Rename binaries
run: |
mv ./linux-amd64/phlow ./linux-amd64/phlow-amd64
mv ./linux-arm64/phlow ./linux-arm64/phlow-arm64
mv ./macos/phlow ./macos/phlow-macos
- name: Upload binaries to GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ needs.app_version.outputs.version }}
name: Release v${{ needs.app_version.outputs.version }}
files: |
./linux-amd64/phlow-amd64
./linux-arm64/phlow-arm64
./macos/phlow-macos
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}