-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script and Github workflow to automate colcon updates
- Loading branch information
1 parent
44ad5c0
commit dde852a
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Update colcon packages | ||
on: | ||
schedule: | ||
- cron: "0 12 * * FRI" | ||
workflow_dispatch: | ||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: ros | ||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | ||
- name: Configure git | ||
run: | | ||
git config user.name 'github-actions[bot]' | ||
git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
- name: Update colcon | ||
run: maintainers/scripts/update-colcon.sh --build --commit | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
branch: colcon-updates | ||
delete-branch: true | ||
title: 'Colcon updates' | ||
body: | | ||
Automated changes by `maintainers/scripts/update-colcon.sh` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env nix-shell | ||
#! nix-shell -i bash --pure | ||
#! nix-shell -p jq nix nix-update cacert git | ||
|
||
# Usage: update-colcon.sh [nix-update options] | ||
|
||
set -euo pipefail | ||
|
||
nix eval --json --impure --expr ' | ||
let | ||
pkgs = (import ./. {}); | ||
lib = pkgs.lib; | ||
colconPkgs = lib.filterAttrs (n: v: builtins.substring 0 7 n == "colcon-") pkgs.python3Packages; | ||
in | ||
lib.attrNames colconPkgs' \ | ||
| jq --raw-output '.[]' \ | ||
| while read pkg; do nix-update "$@" python3Packages."$pkg"; done |