diff --git a/.github/workflows/build-anya.yaml b/.github/build-anya.yaml similarity index 100% rename from .github/workflows/build-anya.yaml rename to .github/build-anya.yaml diff --git a/.github/workflows/build-nishinoya.yaml b/.github/build-nishinoya.yaml similarity index 100% rename from .github/workflows/build-nishinoya.yaml rename to .github/build-nishinoya.yaml diff --git a/.github/workflows/build-totoro.yaml b/.github/build-totoro.yaml similarity index 100% rename from .github/workflows/build-totoro.yaml rename to .github/build-totoro.yaml diff --git a/.github/workflows/updatecli-ci.yaml b/.github/workflows/updatecli-ci.yaml new file mode 100644 index 0000000..d984d13 --- /dev/null +++ b/.github/workflows/updatecli-ci.yaml @@ -0,0 +1,28 @@ +name: Updatecli +on: + pull_request: + pull_request_target: + types: [opened, synchronize, reopened, edited] + workflow_dispatch: + schedule: + - cron: '0 0 * * *' +permissions: + contents: 'write' + pull-requests: 'write' +jobs: + updatecli: + runs-on: 'ubuntu-latest' + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Updatecli in the runner + uses: updatecli/updatecli-action@v2 + - name: Run Updatecli in Dry Run mode + run: 'updatecli diff --config ./updatecli/updatecli.d --values updatecli/values.yaml' + env: + UPDATECLI_GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + - name: Run Updatecli in apply mode + run: 'updatecli apply --config ./updatecli/updatecli.d --values updatecli/values.yaml' + env: + UPDATECLI_GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' diff --git a/updatecli/updatecli.d/nixpkgs.yaml b/updatecli/updatecli.d/nixpkgs.yaml new file mode 100644 index 0000000..4ce050c --- /dev/null +++ b/updatecli/updatecli.d/nixpkgs.yaml @@ -0,0 +1,50 @@ +# manifest.yaml +name: QuickStart example +scms: + default: + kind: 'github' + spec: + user: 'user' + email: 'updatecli@didactiklabs.io' + owner: 'didactiklabs' + repository: 'nixbook' + token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}' + username: 'github-actions' + branch: 'main' +# Defines how to get "source" information such as Jenkins version +sources: + default: + name: Get value from json + kind: json + spec: + file: npins/sources.json + key: .pins.nixpkgs.revision +# Defines "conditions" required to update targets +conditions: + default: + scmid: 'default' + kind: shell + spec: + environments: + - name: PATH + command: echo $(git ls-remote https://github.com/NixOS/nixpkgs nixos-24.11 | awk '{print $1}') == +# Defines "targets" which need to be updated if different than "source" information. +targets: + default: + name: NpinsUpdate + kind: shell + scmid: 'default' + spec: + environments: + - name: PATH + command: npins update nixpkgs && echo +# Define action configurations if one needs to be created +actions: + nixpkgs: + kind: 'github/pullrequest' + scmid: 'default' + spec: + automerge: false + description: 'Prepend description' + draft: false + title: 'Pull Request Title' diff --git a/updatecli/values.yaml b/updatecli/values.yaml new file mode 100644 index 0000000..3df043c --- /dev/null +++ b/updatecli/values.yaml @@ -0,0 +1,5 @@ +github: + user: 'GitHub Actions Bot' + email: 'bots@didactiklabs.io' + username: 'didactik-bot' + token: 'UPDATECLI_GITHUB_TOKEN'