| 8 Sep 2021 |
kranzes | Runs automatically every 3 days and creates a commit | 13:51:03 |
kranzes | I will try to make something similar that will work for both 17.1 and 18.1 on official robotnix | 13:51:47 |
kranzes | then create a PR | 13:51:50 |
kranzes | This is my first time ever using github actions but it seems to be working fine | 13:52:43 |
kranzes | danielrf: how do you generate a format like 2021.08.10.22 from date +%s? | 14:19:25 |
kranzes | Right now im stuck at the point where im trying to create the git commit in that format according to the buildDateTime | 14:21:51 |
kranzes | so far i made this
name: "Update LineageOS"
on: { schedule: [{ cron: '0 0 */3 * *' }], workflow_dispatch }
jobs:
updates:
name: "Update LineageOS"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v13
with:
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210823_af94b54/install
extra_nix_config: |
experimental-features = nix-command flakes
# Update lineage-18.1
- run: nix develop -c ./flavors/lineageos/update.sh lineage-18.1
# Update lineage-17.1
- run: nix develop -c ./flavors/lineageos/update.sh lineage-17.1
# Update buildDateTime
- run: sed -i "s/buildDateTime = mkDefault .*/buildDateTime = mkDefault $(date +%s);/" flavors/lineageos/default.nix
- uses: EndBug/add-and-commit@v7.3.0
with:
author_name: CHANGEME
author_email: CHANGEME
message: 'lineageos: '
add: 'flavors/lineageos/{default.nix,lineage-18.1,lineage-17.1}'
| 14:24:58 |
kranzes | I got it | 14:35:03 |
kranzes | danielrf:
name: "Update LineageOS"
on: { schedule: [{ cron: '0 0 * * 0' }], workflow_dispatch }
jobs:
updates:
name: "Update LineageOS"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v13
with:
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20210823_af94b54/install
extra_nix_config: |
experimental-features = nix-command flakes
# Update lineage-18.1
- run: nix develop -c ./flavors/lineageos/update.sh lineage-18.1
# Update lineage-17.1
- run: nix develop -c ./flavors/lineageos/update.sh lineage-17.1
# Generate date
- env:
DATE: $(date +%s)
# Update buildDateTime
- run: sed -i "s/buildDateTime = mkDefault .*/buildDateTime = mkDefault $DATE;/" flavors/lineageos/default.nix
- uses: EndBug/add-and-commit@v7.3.0
with:
author_name: danielfullmer
message: 'lineageos: $(date +%Y.%m.%d.%H -d @$DATE)'
add: '["flavors/lineageos/default.nix","flavors/lineageos/lineage-18.1","flavors/lineageos/lineage-17.1"]'
tag: 'lineageos-$(date +%Y.%m.%d.%H -d @$DATE)'
| 15:34:06 |
kranzes | This should be ready | 15:34:13 |
kranzes | * This should be good | 15:34:17 |
kranzes | I tested the commands manually, i havent tested this exact workflow as a whole | 15:36:11 |
kranzes | Could you give it a try? | 15:36:19 |
danielrf | kranzes: The buildNumber is set by default to a string representation of the buildDateTime: https://github.com/danielfullmer/robotnix/blob/360a68fa7a28da386779582ae1120274c750d9de/modules/base.nix#L216 | 16:17:58 |
danielrf | You can extract this by evaluating an image. See, for example, scripts/release-tag.sh. | 16:18:33 |
danielrf | There I get the buildNumber to use when tagging via: nix eval -f . --arg configuration "{flavor=\"$FLAVOR\";}" --raw config.buildNumber | 16:19:05 |
danielrf | For something like this, we'd want to grab the buildNumber before and after changing the buildDateTime so we can make a nice commit message like: <flavor>: <prevBuildNumber> -> <newBuildNumber> | 16:20:00 |
danielrf | I'll try to take a closer look at this github action soon. A CI-based auto-update has been a feature I've wanted for a while, but up until now I've just been trying to get the update scripts robust enough. I also need to look into if we'd run into bandwidth/time limits using Github actions like this. | 16:23:26 |
danielrf | cde: Hi, I've got a barbet image built if you're available to test: https://drive.google.com/file/d/1sCIjrZcoORd9PdVebqdRr88JncbNX3OO/view?usp=sharing | 16:24:00 |
cde | downloading | 16:24:38 |
cde | avb key? | 16:26:40 |
danielrf | It's an unsigned image | 16:26:51 |
danielrf | eh--hold off for a sec | 16:28:17 |
danielrf | I should provide a full signed image that tests AVB too | 16:28:28 |
cde | too late | 16:28:29 |
danielrf | lol | 16:28:34 |
cde | boots | 16:31:16 |
cde | seeing this wallpaper after so long | 16:31:22 |
cde | only 10 apps, 1 of them being chromium which you build - sad state of aosp. | 16:31:50 |
danielrf | haha, yep thats AOSP. Still salty that google lets its AOSP apps languish and focuses instead on their closed-source ones | 16:33:20 |