Skip to content

Commit a5b91fa

Browse files
authored
Merge pull request #33 from maxomatic458/dev
UI improvements + workflow updates
2 parents 8bdc430 + 5d41721 commit a5b91fa

File tree

24 files changed

+1910
-1875
lines changed

24 files changed

+1910
-1875
lines changed

.github/workflows/release-ui.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: 'Release UI'
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
4+
release:
5+
types: [published]
86
# This workflow will trigger on each push to the `master` branch to create or update a GitHub release, build your app, and upload the artifacts to the release.
97

108
jobs:

.github/workflows/rust-release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
name: Build and Package Binaries
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
target: x86_64-unknown-linux-gnu
16+
artifact_name: lantun-linux-x86_64.zip
17+
- os: windows-latest
18+
target: x86_64-pc-windows-msvc
19+
artifact_name: lantun-windows-x86_64.zip
20+
- os: macos-latest
21+
target: x86_64-apple-darwin
22+
artifact_name: lantun-macos-x86_64.zip
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Rust
29+
uses: actions-rs/toolchain@v1
30+
with:
31+
toolchain: stable
32+
target: ${{ matrix.target }}
33+
override: true
34+
35+
- name: Build release binary
36+
run: cargo build --release --target ${{ matrix.target }}
37+
38+
- name: Prepare binary for packaging
39+
shell: bash
40+
run: |
41+
mkdir dist
42+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
43+
cp target/${{ matrix.target }}/release/lantun.exe dist/
44+
else
45+
cp target/${{ matrix.target }}/release/lantun dist/
46+
fi
47+
48+
- name: Package binary (zip)
49+
shell: bash
50+
run: |
51+
cd dist
52+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
53+
7z a ../${{ matrix.artifact_name }} lantun.exe
54+
else
55+
zip ../${{ matrix.artifact_name }} lantun
56+
fi
57+
58+
- name: Upload artifact
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: ${{ matrix.artifact_name }}
62+
path: ${{ matrix.artifact_name }}
63+
64+
upload:
65+
name: Upload Release Assets
66+
needs: build
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Download all build artifacts
70+
uses: actions/download-artifact@v4
71+
with:
72+
path: artifacts
73+
74+
- name: List artifacts
75+
run: ls -R artifacts
76+
77+
- name: Upload assets to GitHub Release
78+
uses: softprops/action-gh-release@v2
79+
with:
80+
files: |
81+
artifacts/**/lantun-*.zip
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)