Skip to content

Commit 240cc9c

Browse files
committed
Add registrator workflow
1 parent a8b97a1 commit 240cc9c

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/Registrator.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "Reusable Registrator Workflow"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
localregistry:
7+
description: 'URLs of the local registry where the package should be registered.
8+
Specified by providing the url (https/ssh) to the Github repositories as a newline (\n) seperated list.'
9+
required: true
10+
type: string
11+
secrets:
12+
REGISTRATOR_KEY:
13+
required: true
14+
15+
jobs:
16+
registrator:
17+
name: "Register package version"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check if Julia is already available in the PATH
21+
id: julia_in_path
22+
run: which julia
23+
continue-on-error: true
24+
- name: Install Julia, but only if it is not already available in the PATH
25+
uses: julia-actions/setup-julia@v2
26+
with:
27+
version: "${{ inputs.julia-version }}"
28+
arch: ${{ runner.arch }}
29+
if: steps.julia_in_path.outcome != 'success'
30+
- name: "Add the General registry via Git"
31+
run: |
32+
import Pkg
33+
ENV["JULIA_PKG_SERVER"] = ""
34+
Pkg.Registry.add("General")
35+
shell: julia --color=yes {0}
36+
37+
- name: Checkout package
38+
uses: actions/checkout@v4
39+
with:
40+
path: package
41+
- name: Checkout local registry
42+
uses: actions/checkout@v4
43+
with:
44+
repository: "${{ inputs.localregistry }}"
45+
path: registry
46+
47+
- name: Install LocalRegistry.jl
48+
run: |
49+
import Pkg
50+
name = "LocalRegistry"
51+
uuid = "89398ba2-070a-4b16-a995-9893c55d93cf"
52+
version = "0.5.7"
53+
Pkg.add(; name, uuid, version)
54+
shell: julia --project --color=yes {0}
55+
56+
- name: Update local registry
57+
run: |
58+
using LocalRegistry
59+
package = "./package"
60+
registry = "./registry"
61+
register(package; registry, commit=false, push=false)
62+
shell: julia --project --color=yes {0}
63+
64+
- name: Create PR to registry
65+
uses: peter-evans/create-pull-request@v7
66+
with:
67+
path: registry
68+
branch-suffix: short-commit-hash
69+
title: "New package version: ${{ github.repository }}"
70+
token: ${{ secrets.REGISTRATOR_KEY }}
71+
push-to-fork: lkdvos/ITensorRegistry

0 commit comments

Comments
 (0)