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

add emacs snapshot update action #22

Merged
merged 3 commits into from Jun 7, 2023

Conversation

piotrkwiecinski
Copy link
Contributor

@piotrkwiecinski piotrkwiecinski commented Jun 4, 2023

This is a scheduled action. It triggers once a month.
It updates flake lock and creates a PR if file content changed.

In addition it's possible to trigger the action manually.

resolves #21

@piotrkwiecinski
Copy link
Contributor Author

piotrkwiecinski commented Jun 4, 2023

@akirak would could you have a look and validate if we need to add anything else? You're more experienced with nix.
Should we include:

extraPullNames: nix-community

@akirak
Copy link
Contributor

akirak commented Jun 4, 2023

Should we include: extraPullNames: nix-community

No. nix flake update only updates the inputs specified in the inputs section of flake.nix, so we won't build packages in this workflow. (flake-utils and systems are not defined in the flake, but they are included in the global registry of Nix.)

Even if we build packages, we only need Emacs executables, which is available on emacs-ci cache on Cachix, which is configured in the flake.nix of this repository. To enable the cache, you only need --accept-flake-config flag (or accept-flake-config = true in the config file as in test workflow):

nix develop .#emacs-release-snapshot --accept-flake-config

Copy link
Contributor

@akirak akirak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that peter-evans/create-pull-request doesn't trigger workflows by default. See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs for information.

- uses: cachix/install-nix-action@v21
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
Copy link
Contributor

@akirak akirak Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this line because we only run nix flake update which doesn't depend on a nixpkgs channel.

@piotrkwiecinski
Copy link
Contributor Author

@akirak do we also need --accept-flake-config added to flake update action?

@piotrkwiecinski
Copy link
Contributor Author

piotrkwiecinski commented Jun 4, 2023

Note that peter-evans/create-pull-request doesn't trigger workflows by default. See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs for information.

Thank you for highlighting it.
@zonuexe which option do you prefer?
I reckon we could go with https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens or https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-using-ssh-deploy-keys but it's going to need some ground work done by you.

As we don't push to remote repository deployment ssh key should be enough.

@akirak
Copy link
Contributor

akirak commented Jun 4, 2023

do we also need --accept-flake-config added to flake update action?

No, we need it only for nix develop. I have already added it to the test workflow (see below), but it's unneeded for updating.

    - uses: cachix/install-nix-action@v21
      with:
        extra_nix_config: |
          access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
          # Use the binary cache configured in `nixConfig` section
          accept-flake-config = true

@piotrkwiecinski
Copy link
Contributor Author

@zonuexe I have updated PR to use https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-using-ssh-deploy-keys

Please generated a SSH key and add private key as SSH_PRIVATE_KEY in GitHub action secrets.

This should be good enough for us.

@zonuexe
Copy link
Member

zonuexe commented Jun 7, 2023

I generated a new SSH key and set it as deploy key and secrets.SSH_PRIVATE_KEY.

@zonuexe zonuexe merged commit 6b397ef into emacs-php:master Jun 7, 2023
@zonuexe
Copy link
Member

zonuexe commented Jun 7, 2023

Thank you all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a scheduled action to update Emacs snapshots for CI
3 participants