CI #337
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
name: CI | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_run: | |
workflows: | |
- Trigger | |
types: | |
- completed | |
schedule: | |
- cron: '25 23 */3 * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
submodules: true | |
- name: Guix cache | |
if: ${{ ! steps.guix_pack_cache.outputs.cache-hit }} | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/guix | |
key: guix-cache | |
restore-keys: | | |
guix-cache | |
- name: Install Guix | |
id: install-guix | |
uses: TxGVNN/guix-install-action@v1 | |
with: | |
channels: |- | |
(list (channel | |
(name 'guix) | |
(url "https://git.savannah.gnu.org/git/guix.git")) | |
(channel | |
(name 'guxti) | |
(url "https://github.com/TxGVNN/guxti"))) | |
- name: Install packages | |
shell: bash | |
run: | | |
guix package -m manifest.scm | |
- name: Build Emacs Lisp Package Archive | |
shell: bash | |
run: | | |
. ~/.guix-profile/etc/profile | |
mkdir -p ~/.emacs.d | |
cp early-init.el ~/.emacs.d/ | |
export elpa_mirror_dir=$(find ~/.guix-profile/share/ -name elpa-mirror\*) | |
emacs --batch -nw -l ${elpa_mirror_dir}/elpa-mirror-autoloads.el --eval '(elpamr-create-mirror-for-installed "packages")' | |
- name: Publish packages | |
run: | | |
cd packages | |
ls -l | awk '{print "<li><a href=\""$9"\">"$9"</a></li>"}' > index.html | |
git init --initial-branch=packages | |
cp ../.git/config .git/ | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "Build packages" | |
git push --force origin packages |