Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/release-ui.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: 'Release UI'

on:
push:
branches:
- master

release:
types: [published]
# 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.

jobs:
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/rust-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Release

on:
release:
types: [published]

jobs:
build:
name: Build and Package Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: lantun-linux-x86_64.zip
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: lantun-windows-x86_64.zip
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: lantun-macos-x86_64.zip

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true

- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}

- name: Prepare binary for packaging
shell: bash
run: |
mkdir dist
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
cp target/${{ matrix.target }}/release/lantun.exe dist/
else
cp target/${{ matrix.target }}/release/lantun dist/
fi

- name: Package binary (zip)
shell: bash
run: |
cd dist
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
7z a ../${{ matrix.artifact_name }} lantun.exe
else
zip ../${{ matrix.artifact_name }} lantun
fi

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}

upload:
name: Upload Release Assets
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: List artifacts
run: ls -R artifacts

- name: Upload assets to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/**/lantun-*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading