|
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*] |
5 | 5 |
|
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 |
14 | 14 |
|
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 |
21 | 21 |
|
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 |
26 | 26 |
|
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 |
31 | 31 |
|
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}" |
37 | 37 |
|
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 |
42 | 42 |
|
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 |
47 | 47 |
|
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 |
54 | 54 |
|
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 |
61 | 61 |
|
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')" |
64 | 64 |
|
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