lapce/.github/workflows/release.yml

127 lines
3.9 KiB
YAML

name: Release
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_TERM_COLOR: always
jobs:
windows:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Update rust
run: rustup update
- name: Build
run: cargo build --profile release-lto
- name: Install WiX
run: nuget install WiX
- name: Crate msi installer
run: |
./WiX.*/tools/candle.exe -arch "x64" -ext WixUIExtension -ext WixUtilExtension \
-out "./lapce.wixobj" "extra/windows/wix/lapce.wxs"
./WiX.*/tools/light.exe -ext WixUIExtension -ext WixUtilExtension \
-out "./Lapce-windows.msi" -sice:ICE61 -sice:ICE91 \
"./lapce.wixobj"
- name: Create portable
shell: pwsh
run: |
Compress-Archive ./target/release/lapce.exe ./Lapce-windows-portable.zip
- name: Upload msi installer
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Lapce-windows.msi
file_glob: true
tag: ${{ github.ref }}
overwrite: true
- name: Upload portable
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Lapce-windows-portable.zip
file_glob: true
tag: ${{ github.ref }}
overwrite: true
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get install cmake pkg-config libfreetype6-dev libfontconfig1-dev \
libxcb-xfixes0-dev libxkbcommon-dev
- name: Update rust
run: rustup update
- name: Build
run: cargo build --profile release-lto
- name: Gzip
run: |
mkdir Lapce
cp ./target/release/lapce Lapce/
tar -zcvf ./Lapce-linux.tar.gz Lapce
gzip -c "./target/release/lapce-proxy" > ./lapce-proxy-linux.gz
- name: Upload Application
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Lapce-linux.tar.gz
file_glob: true
tag: ${{ github.ref }}
overwrite: true
- name: Upload Application
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./lapce-proxy-linux.gz
file_glob: true
tag: ${{ github.ref }}
overwrite: true
macos:
runs-on: macos-11
env:
NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }}
NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Install ARM target
run: rustup update && rustup target add aarch64-apple-darwin
- name: Import Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- name: Make DMG
run: make dmg-universal
- name: Rename
run: |
cp ./target/release/macos/Lapce.dmg ./target/release/macos/Lapce-macos.dmg
- name: "Notarize Release Build"
run: |
npx notarize-cli --file ./target/release/macos/Lapce-macos.dmg --bundle-id io.lapce --asc-provider CYSGAZFR8D
- name: "Staple Release Build"
uses: devbotsxyz/xcode-staple@v1
with:
product-path: "./target/release/macos/Lapce-macos.dmg"
- name: Upload Application
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./target/release/macos/Lapce-macos.dmg
file_glob: true
tag: ${{ github.ref }}
overwrite: true