Skip to content

Commit

Permalink
README: add f-b-t Rust/Cargo template
Browse files Browse the repository at this point in the history
Checks `cargo` in #8
  • Loading branch information
TheEvilSkeleton committed Sep 25, 2021
1 parent 0c5d264 commit 871ea7b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:

env:
MANIFEST_PATH: # Path to manifest
REPO: # link to project repository (optional)
# Update dependencies using flatpak-builder-tools (optional)
UPSTREAM_REPOSITORY: # Link to project repository
UPSTREAM_BRANCH: # Preferred branch of upstream repository

jobs:
update:
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,22 @@ You accomplish this by doing the following:
4. From here you could change the visibility of your container to allow everyone to read your container.

## Automatic checker update templates

One of the benefits of using this instead of Flathub is auto-updating dependencies using [flatpak-builder-tools](https://github.com/flathub/flatpak-external-data-checker/) automatically.
One of the benefits of using this instead of Flathub is auto-updating dependencies using [flatpak-builder-tools](https://github.com/flathub/flatpak-external-data-checker/) automatically.

### Rust/Cargo

This will update `cargo-sources.json` hourly if needed. It will need to be placed between the "Update manifest" and "Push to branch" jobs inside the [update.yml](.github/workflows/update.yml) file.
```yaml
- name: Update Rust dependencies
continue-on-error: true
run: |
set -x
apt-get install -y python3-aiohttp python3-toml
git clone -b ${UPSTREAM_BRANCH} ${UPSTREAM_REPOSITORY} upstream
cd upstream
git clone https://github.com/flatpak/flatpak-builder-tools.git flatpak-builder-tools
python3 flatpak-builder-tools/cargo/flatpak-cargo-generator.py Cargo.lock -o ../main/cargo-sources.json
cd ../main
git add cargo-sources.json
git commit -m "Update cargo-sources.json"
```

0 comments on commit 871ea7b

Please sign in to comment.