Skip to content

Import Packages

Import Packages #367

Workflow file for this run

# This workflow automates daily imports of new releases for legacy packages.
name: Import Packages
# The importer is run every day at 07:00 UTC and can also be run manually from
# the 'Actions' tab.
on:
workflow_dispatch:
schedule:
- cron: "0 7 * * *"
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.PACCHETTIBOTTI_TOKEN }}
PACCHETTIBOTTI_TOKEN: ${{ secrets.PACCHETTIBOTTI_TOKEN }}
PACCHETTIBOTTI_ED25519_PUB: ${{ secrets.PACCHETTIBOTTI_ED25519_PUB }}
PACCHETTIBOTTI_ED25519: ${{ secrets.PACCHETTIBOTTI_ED25519 }}
SPACES_KEY: ${{ secrets.SPACES_KEY }}
SPACES_SECRET: ${{ secrets.SPACES_SECRET }}
steps:
# Checks out the registry-dev repository so we can run scripts from it
- uses: actions/checkout@v3
with:
repository: purescript/registry-dev
token: ${{ env.PACCHETTIBOTTI_TOKEN }}
# We cache NPM and PureScript dependencies, as well as persist the in-memory
# cache used by the registry importer
- name: Cache NPM dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache PureScript dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.yaml') }}
path: |
.spago
output
- name: Set current time
run: echo "NOW=$(date)" >> $GITHUB_ENV
- name: Cache importer artifacts
uses: actions/cache@v2
with:
# This cache directory is meant to be essentially permanent, with cache
# expiry implemented in code. However, we never want this to be a direct
# cache hit, or else new writes to the cache won't be saved. We want a
# partial hit by using a restore-key, which means the cache will always
# be saved with new changes, and will always be restored.
key: cache-1-${{ env.NOW }}
restore-keys: |
cache-1-
path: |
scratch/.cache
# The registry repository uses a number of system tools, so it's necessary we
# make them available via Nix
- name: Install Nix
uses: cachix/install-nix-action@v16
with:
extra_nix_config: |
access-tokens = github.com=${{ env.PACCHETTIBOTTI_TOKEN }}
# Finally, we can execute the importer.
- name: Build
run: nix develop --command 'registry-build'
- name: Run the importer
run: nix develop --command 'registry-importer' 'update-registry'
- name: Run the transferrer
run: nix develop --command 'registry-package-transferrer'
- name: Import new versions to the package sets
run: nix develop --command 'registry-package-set-updater' 'commit'