truncate names in active now section #239
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: ['main'] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
jobs: | |
build-mac-x86_64: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "./src-tauri -> target" | |
- name: Install tauri CLI | |
run: cargo install tauri-cli | |
- name: Install packages | |
run: npm i | |
- name: Build | |
run: cargo tauri build --target x86_64-apple-darwin | |
- name: Upload artifact x86_64 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-darwin-86_64 | |
path: | | |
src-tauri/target/x86_64-apple-darwin/release/bundle/macos | |
src-tauri/target/x86_64-apple-darwin/release/bundle/dmg | |
build-mac-aarch64: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "./src-tauri -> target" | |
- name: Install tauri CLI | |
run: cargo install tauri-cli | |
- name: Install packages | |
run: npm i | |
- name: Build | |
run: rustup target add aarch64-apple-darwin && cargo tauri build --target aarch64-apple-darwin | |
- name: Upload artifact aarch64 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-darwin-aarch64 | |
path: | | |
src-tauri/target/aarch64-apple-darwin/release/bundle/macos | |
src-tauri/target/aarch64-apple-darwin/release/bundle/dmg | |
build-win-x86_64: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "./src-tauri -> target" | |
- name: Install tauri CLI | |
run: cargo install tauri-cli | |
- name: Install packages | |
run: npm i | |
- name: Build | |
run: cargo tauri build --target x86_64-pc-windows-msvc | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-windows-86_64 | |
path: | | |
src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis | |
build-win-i686: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "./src-tauri -> target" | |
- name: Install tauri CLI | |
run: cargo install tauri-cli | |
- name: Install packages | |
run: npm i | |
- name: Build | |
run: rustup target add i686-pc-windows-msvc && cargo tauri build --target i686-pc-windows-msvc | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-windows-i686 | |
path: | | |
src-tauri/target/i686-pc-windows-msvc/release/bundle/nsis | |
build-linux-x86_64: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "./src-tauri -> target" | |
- name: Install tauri CLI | |
run: cargo install tauri-cli | |
- name: Install packages | |
run: npm i | |
- name: Install build deps | |
run: | | |
sudo apt update | |
sudo apt install libwebkit2gtk-4.0-dev \ | |
build-essential \ | |
curl \ | |
wget \ | |
libssl-dev \ | |
libgtk-3-dev \ | |
libayatana-appindicator3-dev \ | |
librsvg2-dev | |
- name: Build | |
run: cargo tauri build --target x86_64-unknown-linux-gnu | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-linux-x86_64 | |
path: | | |
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage | |
!src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/adapt.AppDir | |
!src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.sh | |
- name: Upload .deb artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-linux-x86_64 | |
path: | | |
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb | |
deploy-to-downloads: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
runs-on: ubuntu-20.04 | |
needs: [build-mac-x86_64, build-mac-aarch64, build-win-x86_64, build-win-i686, build-linux-x86_64] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download darwin-x86_64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: app-darwin-86_64 | |
path: darwin-x86_64 | |
- name: Download darwin-aarch64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: app-darwin-aarch64 | |
path: darwin-aarch64 | |
- name: Download windows-x86_64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: app-windows-86_64 | |
path: windows-x86_64 | |
- name: Download windows-i686 | |
uses: actions/download-artifact@v3 | |
with: | |
name: app-windows-i686 | |
path: windows-i686 | |
- name: Download linux-x86_64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: app-linux-x86_64 | |
path: linux-x86_64 | |
- name: Change paths | |
run: | | |
mv darwin-x86_64/macos/* darwin-x86_64 | |
mv darwin-x86_64/dmg/* darwin-x86_64 | |
mv darwin-aarch64/macos/* darwin-aarch64 | |
mv darwin-aarch64/dmg/* darwin-aarch64 | |
rm -rf darwin-*/macos darwin-*/dmg darwin-*/*.sh darwin-*/*.icns darwin-*/support | |
cd darwin-x86_64/Adapt.app | |
zip -r ../Adapt.app.zip . | |
cd ../../darwin-aarch64/Adapt.app | |
zip -r ../Adapt.app.zip . | |
cd ../.. | |
rm -rf darwin-x86_64/Adapt.app darwin-aarch64/Adapt.app | |
mv darwin-x86_64/*.dmg darwin-x86_64/Adapt-installer.dmg | |
mv darwin-aarch64/*.dmg darwin-aarch64/Adapt-installer.dmg | |
mv windows-x86_64/*-setup.exe windows-x86_64/Adapt-setup.exe | |
mv windows-x86_64/*.nsis.zip windows-x86_64/Adapt-nsis.zip | |
mv windows-x86_64/*.nsis.zip.sig windows-x86_64/Adapt-nsis.zip.sig | |
mv windows-i686/*-setup.exe windows-i686/Adapt-setup.exe | |
mv windows-i686/*.nsis.zip windows-i686/Adapt-nsis.zip | |
mv windows-i686/*.nsis.zip.sig windows-i686/Adapt-nsis.zip.sig | |
mv linux-x86_64/*.AppImage linux-x86_64/Adapt.AppImage | |
mv linux-x86_64/*.AppImage.tar.gz linux-x86_64/Adapt.AppImage.tar.gz | |
mv linux-x86_64/*.AppImage.tar.gz.sig linux-x86_64/Adapt.AppImage.tar.gz.sig | |
mv linux-x86_64/*.deb linux-x86_64/Adapt.deb | |
rm -rf linux-x86_64/*_amd64 | |
- name: Copy to artifacts dir | |
run: | | |
mkdir download-artifacts | |
cp -r darwin-x86_64 download-artifacts | |
cp -r darwin-aarch64 download-artifacts | |
cp -r windows-x86_64 download-artifacts | |
cp -r windows-i686 download-artifacts | |
cp -r linux-x86_64 download-artifacts | |
mv download-artifacts webclient | |
mkdir download-artifacts | |
mv webclient download-artifacts/webclient | |
- name: Generate webclient-latest.json | |
run: | | |
import json | |
import datetime | |
v = open('src-tauri/Cargo.toml', 'r').read().split('version = "')[1].split('"')[0] | |
with open('download-artifacts/webclient/webclient-latest.json', 'w') as f: | |
f.write( | |
json.dumps({ | |
"version": v, | |
"pub_date": datetime.datetime.now(datetime.timezone.utc).isoformat(), | |
"platforms": { | |
"darwin-x86_64": { | |
"signature": open('darwin-x86_64/Adapt.app.tar.gz.sig', 'r').read(), | |
"url": "https://download.adapt.chat/webclient/darwin-x86_64/Adapt.app.tar.gz" | |
}, | |
"darwin-aarch64": { | |
"signature": open('darwin-aarch64/Adapt.app.tar.gz.sig', 'r').read(), | |
"url": "https://download.adapt.chat/webclient/darwin-aarch64/Adapt.app.tar.gz" | |
}, | |
"windows-x86_64": { | |
"signature": open('windows-x86_64/Adapt-nsis.zip.sig', 'r').read(), | |
"url": "https://download.adapt.chat/webclient/windows-x86_64/Adapt-nsis.zip" | |
}, | |
"windows-i686": { | |
"signature": open('windows-i686/Adapt-nsis.zip.sig', 'r').read(), | |
"url": "https://download.adapt.chat/webclient/windows-i686/Adapt-nsis.zip" | |
}, | |
"linux-x86_64": { | |
"signature": open('linux-x86_64/Adapt.AppImage.tar.gz.sig', 'r').read(), | |
"url": "https://download.adapt.chat/webclient/linux-x86_64/Adapt.AppImage.tar.gz" | |
} | |
} | |
}) | |
) | |
shell: python | |
- name: Show artifacts | |
run: ls -R download-artifacts | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: 'download-artifacts' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |