Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build from source & enable aarch64 build #55

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
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
54 changes: 54 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Auto update

on:
push:

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Setup environment variables
run: |
echo "FLATPAK_BUILDER_TOOLS_DIR=/tmp/flatpak-builder-tools" >> $GITHUB_ENV
echo "BITWARDEN_DESKTOP_VERSION="$(yq '.modules[1].sources[0].tag' 'com.bitwarden.desktop.yaml')"" >> $GITHUB_ENV

- name: Setup flatpak-builder-tools
run: |
git clone --depth=1 https://github.com/flatpak/flatpak-builder-tools ${FLATPAK_BUILDER_TOOLS_DIR}
pip install --user pipx && pipx install ${FLATPAK_BUILDER_TOOLS_DIR}/node
pip install --user toml aiohttp

# Need to replace git+ssh with git+https:// since Flathub only supports git+http(s)://
- name: Update Node.js generated sources
run: |
wget "https://github.com/bitwarden/clients/raw/${BITWARDEN_DESKTOP_VERSION}/package-lock.json" -O package-lock.json

sed -i -e "s,git+ssh://[email protected]/,git+https://github.com/,g" package-lock.json

flatpak-node-generator --electron-node-headers npm package-lock.json -o node-sources.json
rm package-lock.json

- name: Update Rust generated sources
run: |
wget "https://github.com/bitwarden/clients/raw/${BITWARDEN_DESKTOP_VERSION}/apps/desktop/desktop_native/Cargo.lock" -O Cargo.lock
python3 ${FLATPAK_BUILDER_TOOLS_DIR}/cargo/flatpak-cargo-generator.py Cargo.lock -o cargo-sources.json
rm Cargo.lock

- name: Commit updates
run: |
set -e

[[ ! $(git status --porcelain) ]] && exit 0

git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config user.name "Workflow trigger"

git add node-sources.json cargo-sources.json
git commit -m 'Update generated sources'

git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}
Loading