feat: update elk to v0.10.1 (#80) #83
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: covector version or publish | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
version-or-publish: | |
runs-on: ubuntu-latest | |
outputs: | |
changelog: ${{ fromJSON(steps.covector.outputs.templatePipe).elk-native.pipe.pkg.changelog }} | |
published: "${{ contains(steps.covector.outputs.packagesPublished, 'elk-native') }}" | |
# published: ${{ steps.covector.outputs.successfulPublish }} | |
version: ${{ fromJSON(steps.covector.outputs.templatePipe).elk-native.pipe.pkgFile.version }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: git config | |
run: | | |
git config --global user.name "${{ github.event.pusher.name }}" | |
git config --global user.email "${{ github.event.pusher.email }}" | |
- name: covector version-or-publish | |
uses: jbolda/covector/packages/action@covector-v0 | |
id: covector | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
command: 'version-or-publish' | |
- run: | | |
echo "${{ contains(steps.covector.outputs.packagesPublished, 'elk-native') }}" | |
echo "${{ steps.covector.outputs.successfulPublish }}" | |
echo "${{ steps.covector.outputs.published-elk-native }}" | |
- name: Create Pull Request With Versions Bumped | |
id: cpr | |
uses: tauri-apps/create-pull-request@v3 | |
if: steps.covector.outputs.commandRan == 'version' | |
with: | |
title: "Publish New Versions" | |
labels: "version updates" | |
branch: "release" | |
body: ${{ steps.covector.outputs.change }} | |
create-and-upload-assets: | |
runs-on: ${{ matrix.config.os }} | |
needs: [version-or-publish] | |
if: needs.version-or-publish.outputs.published == 'true' | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- os: ubuntu-latest | |
arch: x86_64 | |
rust_target: x86_64-unknown-linux-gnu | |
- os: macos-latest | |
arch: x86_64 | |
rust_target: x86_64-apple-darwin | |
- os: macos-latest | |
arch: aarch64 | |
rust_target: aarch64-apple-darwin | |
- os: windows-latest | |
arch: x86_64 | |
rust_target: x86_64-pc-windows-msvc | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: "Setup Rust" | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.config.rust_target }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.config.rust_target }} | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: pnpm | |
cache-dependency-path: elk/pnpm-lock.yaml | |
- name: Install dependencies | |
run: cd elk && pnpm install --force | |
- name: "Install native packages" | |
if: "matrix.config.os == 'ubuntu-latest'" | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf | |
- name: create apple private key file | |
if: "matrix.config.os == 'macos-latest'" | |
run: | | |
mkdir ./src-tauri/private_keys | |
echo "$APPLE_API_PRIVKEY" > ./src-tauri/private_keys/AuthKey_$APPLE_API_KEY.p8 | |
env: | |
APPLE_API_PRIVKEY: '${{ secrets.APPLE_API_PRIVKEY }}' | |
APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' | |
- uses: JonasKruckenberg/tauri-build@v1.2.2 | |
id: tauri_build | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
ENABLE_CODE_SIGNING: '${{ secrets.APPLE_CERTIFICATE }}' | |
APPLE_API_ISSUER: '${{ secrets.APPLE_API_ISSUER }}' | |
APPLE_API_KEY: '${{ secrets.APPLE_API_KEY }}' | |
APPLE_CERTIFICATE: '${{ secrets.APPLE_CERTIFICATE }}' | |
APPLE_CERTIFICATE_PASSWORD: '${{ secrets.APPLE_CERTIFICATE_PASSWORD }}' | |
APPLE_SIGNING_IDENTITY: '${{ secrets.APPLE_SIGNING_IDENTITY }}' | |
TAURI_KEY_PASSWORD: '${{ secrets.TAURI_KEY_PASSWORD }}' | |
TAURI_PRIVATE_KEY: '${{ secrets.TAURI_PRIVATE_KEY }}' | |
with: | |
target: ${{ matrix.config.rust_target }} | |
configPath: src-tauri/stable.tauri.conf.json | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts-${{ matrix.config.arch }} | |
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}" | |
- name: Rename elk binary to represent it's architecture and os | |
if: "matrix.config.os == 'ubuntu-latest'" | |
run: | | |
pwd | |
mkdir target/${{ matrix.config.rust_target }}/release/bundle/bin -p | |
cp ./target/${{ matrix.config.rust_target }}/release/elk ./target/${{ matrix.config.rust_target }}/release/bundle/bin/Elk_${{ needs.version-or-publish.outputs.version }}_${{ matrix.config.os }}_${{ matrix.config.arch }} | |
# Upload binaries, | |
- uses: actions/upload-artifact@v3 | |
if: "matrix.config.os == 'ubuntu-latest'" | |
with: | |
name: artifacts-${{ matrix.config.arch }} | |
path: "target/${{ matrix.config.rust_target }}/release/bundle/bin/Elk_${{ needs.version-or-publish.outputs.version }}_${{ matrix.config.os }}_${{ matrix.config.arch }}" | |
publish: | |
needs: [version-or-publish, create-and-upload-assets] | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # required for use of git history | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: pnpm | |
- name: Run pnpm install | |
run: pnpm install | |
- name: git config | |
run: | | |
git config --global user.name "${{ github.event.pusher.name }}" | |
git config --global user.email "${{ github.event.pusher.email }}" | |
- name: Download x86_64 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artifacts-x86_64 | |
path: artifacts/x86_64 | |
- name: Download aarch64 artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: artifacts-aarch64 | |
path: artifacts/aarch64 | |
- name: Rename artifacts | |
run: | | |
mv "artifacts/x86_64/macos/Elk.app.tar.gz" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_macos_x86_64.app.tar.gz" | |
mv "artifacts/x86_64/macos/Elk.app.tar.gz.sig" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_macos_x86_64.app.tar.gz.sig" | |
mv "artifacts/x86_64/dmg/Elk_${{ needs.version-or-publish.outputs.version }}_x64.dmg" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_macos_x86_64.dmg" | |
mv "artifacts/aarch64/macos/Elk.app.tar.gz" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_macos_aarch64.app.tar.gz" | |
mv "artifacts/aarch64/macos/Elk.app.tar.gz.sig" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_macos_aarch64.app.tar.gz.sig" | |
mv "artifacts/aarch64/dmg/Elk_${{ needs.version-or-publish.outputs.version }}_aarch64.dmg" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_macos_aarch64.dmg" | |
mv "artifacts/x86_64/Elk_${{ needs.version-or-publish.outputs.version }}_x64_en-US.msi" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_windows_x86_64.msi" | |
mv "artifacts/x86_64/Elk_${{ needs.version-or-publish.outputs.version }}_x64_en-US.msi.zip" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_windows_x86_64.msi.zip" | |
mv "artifacts/x86_64/Elk_${{ needs.version-or-publish.outputs.version }}_x64_en-US.msi.zip.sig" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_windows_x86_64.msi.zip.sig" | |
mv "artifacts/x86_64/appimage/elk_${{ needs.version-or-publish.outputs.version }}_amd64.AppImage" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_linux_x86_64.AppImage" | |
mv "artifacts/x86_64/appimage/elk_${{ needs.version-or-publish.outputs.version }}_amd64.AppImage.tar.gz" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_linux_x86_64.AppImage.tar.gz" | |
mv "artifacts/x86_64/appimage/elk_${{ needs.version-or-publish.outputs.version }}_amd64.AppImage.tar.gz.sig" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_linux_x86_64.AppImage.tar.gz.sig" | |
mv "artifacts/x86_64/deb/elk_${{ needs.version-or-publish.outputs.version }}_amd64.deb" "./artifacts/Elk_${{ needs.version-or-publish.outputs.version }}_linux_x86_64.deb" | |
- name: Generate latest.json file | |
run: node scripts/latest-json.mjs ${{ needs.version-or-publish.outputs.version }} stable | |
env: | |
CHANGELOG: '${{ needs.version-or-publish.outputs.changelog }}' | |
- name: Commit latest.json | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add latest-*.json | |
git commit -am "Update latest.json" | |
git push origin HEAD:main | |
- name: 'create release' | |
uses: softprops/action-gh-release@master | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
with: | |
tag_name: elk-native-v${{ needs.version-or-publish.outputs.version }} | |
name: Elk Native v${{ needs.version-or-publish.outputs.version }} | |
body: ${{ needs.version-or-publish.outputs.changelog }} | |
files: ./artifacts/**/* | |