Skip to content

Commit 5bac028

Browse files
committed
Migrate to general registry.
1 parent 49183da commit 5bac028

File tree

3 files changed

+17
-124
lines changed

3 files changed

+17
-124
lines changed

.github/workflows/Register.yml

Lines changed: 11 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,16 @@
1-
# You have to set PAT and add secrete ACCESS_OKREGISTRY in the repo {{{PKG}}}
2-
# see also the default template: https://github.com/JuliaCI/PkgTemplates.jl/blob/master/templates/github/workflows/register.yml
3-
# Also see [Running GitHub Actions Sequentially](https://stevenmortimer.com/running-github-actions-sequentially/) to separate updateokreg out from CI.yml, and trigger TagBot sequentially.
4-
# CHECKPOINT: Currently substitution (e.g., {{{PKG}}}) failed.
5-
6-
name: Register Package to OkRegistry
1+
name: Register Package
72
on:
8-
push:
9-
paths:
10-
- "Project.toml"
11-
issue_comment:
12-
types:
13-
- created
143
workflow_dispatch:
15-
16-
env:
17-
# It seems to be redundant to define them first.
18-
CHANGELOG_MESSAGE: "CHANGELOG_MESSAGE not available"
19-
JULIA_VERSION: " "
20-
21-
permissions:
22-
actions: read
23-
checks: read
24-
contents: write
25-
deployments: read
26-
issues: read
27-
discussions: read
28-
packages: read
29-
pages: read
30-
pull-requests: read
31-
repository-projects: read
32-
security-events: read
33-
statuses: read
34-
# `contents: write` is required to allow `peter-evans/repository-dispatch`. You may alternatively on your github go to [settings-actions](https://github.com/okatsn/{{{PKG}}}.jl/settings/actions) to set the default permissions granted to the `GITHUB_TOKEN` to Read and write.
4+
inputs:
5+
version:
6+
description: Version to register or component to bump
7+
required: true
358
jobs:
36-
UpdateOkReg:
37-
# if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
38-
runs-on: ubuntu-24.04
9+
register:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
3913
steps:
40-
- uses: julia-actions/setup-julia@v2
14+
- uses: julia-actions/RegisterAction@latest
4115
with:
42-
version: 1.10.10
43-
- uses: okatsn/add-registry@v2
44-
- uses: actions/checkout@v5 # see https://github.com/actions/checkout
45-
with:
46-
path: TEMP
47-
- uses: actions/checkout@v5 # see https://github.com/actions/checkout
48-
with:
49-
repository: okatsn/OkRegistry
50-
path: OkRegistry
51-
token: ${{ secrets.ACCESS_OKREGISTRY }}
52-
# Update OkRegistry first.
53-
# 1. Current path is critical. Please refer to "add_local_pkg_to_registry.jl" in OkRegistry.
54-
# 2. `git config` is required, and has to be done in repo OkRegistry (cd OkRegistry must precede)
55-
# 3. Personal registry is add per julia install; that is, OkRegistry should be added before `Pkg.instantiate()`
56-
# 4. The empty General registry issue is solved after okatsn/add-registry@v2.0.1; the following code runs only when okatsn/add-registry@v2.0.1 (or later) is applied
57-
- run: |
58-
cd OkRegistry
59-
git config --local user.email "action@github.com"
60-
git config --local user.name "github-actions"
61-
julia --project=@. -e '
62-
using Pkg;
63-
Pkg.instantiate();
64-
using OkRegistrator;
65-
okciregister()
66-
'
67-
cd ..
68-
- uses: okatsn/get-changelog@v1
69-
with:
70-
dir0: TEMP
71-
id: regist
72-
# KEYNOTE:
73-
# - Declare dynamic variables (not used in this script) https://dev.to/a1ex/tricks-of-declaring-dynamic-variables-in-bash-15b9
74-
# - How to override an environment variable in Github Actions? https://stackoverflow.com/questions/66687561/how-to-override-an-environment-variable-in-github-actions
75-
76-
- name: Trigger next workflow # You may alternatively use https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds
77-
if: success() # https://docs.github.com/en/actions/learn-github-actions/expressions#success
78-
# && github.event_name == 'push' # KEYNOTE: must have this condition if `github.event.commits` is used in the followings. `github.event.commits` is only available in [push webhook payload](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
79-
# if: success() # Use this condition instead if `github.event.commits` is not applied herein after AND you want trigger-tagbot dispatch workflows `on` events other that `push`.
80-
env:
81-
CHANGELOG_MESSAGE: ${{ steps.regist.outputs.content }}
82-
JULIA_VERSION: ${{ steps.regist.outputs.version }}
83-
uses: peter-evans/repository-dispatch@v4 # See https://github.com/peter-evans/repository-dispatch
84-
with:
85-
repository: ${{ github.repository }}
86-
event-type: trigger-tagbot
87-
token: ${{ secrets.GITHUB_TOKEN }} # default is GITHUB_TOKEN
88-
client-payload: '{"logfile_msg": "${{ env.CHANGELOG_MESSAGE }}", "version": "${{ env.JULIA_VERSION }}" }'
89-
# Delete this client-payload line and `client_payload` lines in `TagBot.yml` if you don't want commit message appears.
90-
# Push everything else before you push `Project.toml` with version number raised and commit it solely with commit message that will also appear as part of the release notes.
91-
# Also see OkPkgTemplates.PLUGIN_REGISTER() for explanation.
92-
# Noted that multiline string (for commit message) is not acceptable for json. See PLUGIN_REGISTER for more info.
16+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/TagBot.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,21 @@
1-
# Modified from the [Default TagBot template in PkgTemplates](https://github.com/JuliaCI/PkgTemplates.jl/blob/master/templates/github/workflows/TagBot.yml)
2-
31
name: TagBot
42
on:
5-
repository_dispatch:
6-
types: [trigger-tagbot]
73
issue_comment:
84
types:
95
- created
106
workflow_dispatch:
11-
inputs:
12-
lookback:
13-
default: "3"
14-
permissions:
15-
actions: read
16-
checks: read
17-
contents: write
18-
deployments: read
19-
issues: read
20-
discussions: read
21-
packages: read
22-
pages: read
23-
pull-requests: read
24-
repository-projects: read
25-
security-events: read
26-
statuses: read
27-
# For public repo, this is all you need.
28-
# For private repo, you have to add `with: token: TAG_BLABLABLA` of created PAT named `TAG_BLABLABLA` for example with permissions:
29-
# - Read access to actions, deployments, discussions, issues, metadata, pages, and pull requests
30-
# - Read and Write access to code (that is, contents)
317
jobs:
328
TagBot:
33-
if: github.event_name == 'repository_dispatch' # Add this condition if `github.event.client_payload` is applied in the followings to guarantee client_payload exists. Check also `PLUGIN_TAGBOT()` and register.yml
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
3410
runs-on: ubuntu-latest
3511
steps:
3612
- uses: JuliaRegistries/TagBot@v1
3713
with:
3814
token: ${{ secrets.GITHUB_TOKEN }}
15+
# For commits that modify workflow files: SSH key enables tagging, but
16+
# releases require manual creation. For full automation of such commits,
17+
# use a PAT with `workflow` scope instead of GITHUB_TOKEN.
18+
# See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files
3919
ssh: ${{ secrets.DOCUMENTER_KEY }}
4020
changelog: |
4121
## {{ package }} {{ version }}
@@ -58,14 +38,3 @@ jobs:
5838
- {{ pull.title }} (#{{ pull.number }}) (@{{ pull.author.username }})
5939
{% endfor %}
6040
{% endif %}
61-
62-
registry: okatsn/OkRegistry
63-
TagBotNoChangelog: # KEYNOTE: Manually run this to tag previous versions
64-
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
65-
runs-on: ubuntu-latest
66-
steps:
67-
- uses: JuliaRegistries/TagBot@v1
68-
with:
69-
token: ${{ secrets.GITHUB_TOKEN }}
70-
ssh: ${{ secrets.DOCUMENTER_KEY }}
71-
registry: okatsn/OkRegistry

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "HivePaths"
22
uuid = "67cf009d-4aa4-48c9-a112-d5138c970da1"
33
authors = ["okatsn <okatsn@gmail.com> and contributors"]
4-
version = "0.0.4"
4+
version = "0.1.0"
55

66
[compat]
77
julia = "1.10"

0 commit comments

Comments
 (0)