Skip to content

Commit d453489

Browse files
committed
fix: Enable release workflow and update registry repo
1 parent c51f327 commit d453489

1 file changed

Lines changed: 60 additions & 60 deletions

File tree

.github/workflows/release.yml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
# name: Package and push to registry repo
2-
# on:
3-
# push:
4-
# tags: [v*]
1+
name: Package and push to registry repo
2+
on:
3+
push:
4+
tags: [v*]
55

6-
# env:
7-
# # the repository to which to push the release version
8-
# # usually a fork of typst/packages (https://github.com/typst/packages/)
9-
# # that you have push privileges to
10-
# REGISTRY_REPO: author/typst-packages
11-
# # the path within that repo where the "<name>/<version>" directory should be put
12-
# # for the Typst package registry, keep this as is
13-
# PATH_PREFIX: packages/preview
6+
env:
7+
# the repository to which to push the release version
8+
# usually a fork of typst/packages (https://github.com/typst/packages/)
9+
# that you have push privileges to
10+
REGISTRY_REPO: Coders-Compass/packages
11+
# the path within that repo where the "<name>/<version>" directory should be put
12+
# for the Typst package registry, keep this as is
13+
PATH_PREFIX: packages/preview
1414

15-
# jobs:
16-
# release:
17-
# runs-on: ubuntu-latest
18-
# steps:
19-
# - name: Checkout
20-
# uses: actions/checkout@v5
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
2121

22-
# - name: Install just
23-
# uses: taiki-e/install-action@v2
24-
# with:
25-
# tool: just
22+
- name: Install just
23+
uses: taiki-e/install-action@v2
24+
with:
25+
tool: just
2626

27-
# - name: Setup typst
28-
# uses: typst-community/setup-typst@v4
29-
# with:
30-
# typst-version: latest
27+
- name: Setup typst
28+
uses: typst-community/setup-typst@v4
29+
with:
30+
typst-version: latest
3131

32-
# - name: Determine and check package metadata
33-
# run: |
34-
# . scripts/setup
35-
# echo "PKG_NAME=${PKG_PREFIX}" >> "${GITHUB_ENV}"
36-
# echo "PKG_VERSION=${VERSION}" >> "${GITHUB_ENV}"
32+
- name: Determine and check package metadata
33+
run: |
34+
. scripts/setup
35+
echo "PKG_NAME=${PKG_PREFIX}" >> "${GITHUB_ENV}"
36+
echo "PKG_VERSION=${VERSION}" >> "${GITHUB_ENV}"
3737
38-
# if [[ "${GITHUB_REF_NAME}" != "v${VERSION}" ]]; then
39-
# echo "package version ${VERSION} does not match release tag ${GITHUB_REF_NAME}" >&2
40-
# exit 1
41-
# fi
38+
if [[ "${GITHUB_REF_NAME}" != "v${VERSION}" ]]; then
39+
echo "package version ${VERSION} does not match release tag ${GITHUB_REF_NAME}" >&2
40+
exit 1
41+
fi
4242
43-
# - name: Build package
44-
# run: |
45-
# just doc
46-
# just package out
43+
- name: Build package
44+
run: |
45+
just doc
46+
just package out
4747
48-
# - name: Checkout package registry
49-
# uses: actions/checkout@v5
50-
# with:
51-
# repository: ${{ env.REGISTRY_REPO }}
52-
# token: ${{ secrets.REGISTRY_TOKEN }}
53-
# path: typst-packages
48+
- name: Checkout package registry
49+
uses: actions/checkout@v5
50+
with:
51+
repository: ${{ env.REGISTRY_REPO }}
52+
token: ${{ secrets.REGISTRY_TOKEN }}
53+
path: typst-packages
5454

55-
# - name: Release package
56-
# run: |
57-
# mkdir -p "typst-packages/${{ env.PATH_PREFIX }}/$PKG_NAME"
58-
# mv "out/${PKG_NAME}/${PKG_VERSION}" "typst-packages/${{ env.PATH_PREFIX }}/${PKG_NAME}"
59-
# rmdir "out/${PKG_NAME}"
60-
# rmdir out
55+
- name: Release package
56+
run: |
57+
mkdir -p "typst-packages/${{ env.PATH_PREFIX }}/$PKG_NAME"
58+
mv "out/${PKG_NAME}/${PKG_VERSION}" "typst-packages/${{ env.PATH_PREFIX }}/${PKG_NAME}"
59+
rmdir "out/${PKG_NAME}"
60+
rmdir out
6161
62-
# GIT_USER_NAME="$(git log -1 --pretty=format:'%an')"
63-
# GIT_USER_EMAIL="$(git log -1 --pretty=format:'%ae')"
62+
GIT_USER_NAME="$(git log -1 --pretty=format:'%an')"
63+
GIT_USER_EMAIL="$(git log -1 --pretty=format:'%ae')"
6464
65-
# cd typst-packages
66-
# git config user.name "${GIT_USER_NAME}"
67-
# git config user.email "${GIT_USER_EMAIL}"
68-
# git checkout -b "${PKG_NAME}-${PKG_VERSION}"
69-
# git add .
70-
# git commit -m "${PKG_NAME}:${PKG_VERSION}"
71-
# git push --set-upstream origin "${PKG_NAME}-${PKG_VERSION}"
65+
cd typst-packages
66+
git config user.name "${GIT_USER_NAME}"
67+
git config user.email "${GIT_USER_EMAIL}"
68+
git checkout -b "${PKG_NAME}-${PKG_VERSION}"
69+
git add .
70+
git commit -m "${PKG_NAME}:${PKG_VERSION}"
71+
git push --set-upstream origin "${PKG_NAME}-${PKG_VERSION}"

0 commit comments

Comments
 (0)