Skip to content

Commit 3d99987

Browse files
committed
Allow publishing to GitHub Registry
Signed-off-by: Voplica <admin@voplica.com>
1 parent ea93af5 commit 3d99987

File tree

5 files changed

+12
-47
lines changed

5 files changed

+12
-47
lines changed

.github/workflows/artifact-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
runs-on: [ubuntu-latest, windows-latest, macos-latest]
18+
[ubuntu-latest]
1919
fail-fast: false
2020

2121
runs-on: ${{ matrix.runs-on }}

.github/workflows/cache-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
runs-on: [ubuntu-latest, windows-latest, macOS-latest]
18+
runs-on: [ubuntu-latest]
1919
fail-fast: false
2020

2121
runs-on: ${{ matrix.runs-on }}

.github/workflows/releases.yml

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ on:
1111

1212
jobs:
1313
test:
14-
runs-on: macos-latest-large
15-
14+
runs-on: ubuntu-latest
15+
environment: npm-publish
16+
permissions:
17+
contents: read
18+
id-token: write
1619
steps:
1720
- name: setup repo
1821
uses: actions/checkout@v4
@@ -41,45 +44,7 @@ jobs:
4144
run: npm pack
4245
working-directory: packages/${{ github.event.inputs.package }}
4346

44-
- name: upload artifact
45-
uses: actions/upload-artifact@v4
46-
with:
47-
name: ${{ github.event.inputs.package }}
48-
path: packages/${{ github.event.inputs.package }}/*.tgz
49-
50-
publish:
51-
runs-on: macos-latest-large
52-
needs: test
53-
environment: npm-publish
54-
permissions:
55-
contents: read
56-
id-token: write
57-
steps:
58-
59-
- name: download artifact
60-
uses: actions/download-artifact@v4
47+
- uses: JS-DevTools/npm-publish@v3
6148
with:
62-
name: ${{ github.event.inputs.package }}
63-
64-
- name: setup authentication
65-
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
66-
env:
67-
NPM_TOKEN: ${{ secrets.TOKEN }}
68-
69-
- name: publish
70-
run: npm publish --provenance *.tgz
71-
72-
- name: notify slack on failure
73-
if: failure()
74-
run: |
75-
curl -X POST -H 'Content-type: application/json' --data '{"text":":pb__failed: Failed to publish a new version of ${{ github.event.inputs.package }}"}' $SLACK_WEBHOOK
76-
env:
77-
SLACK_WEBHOOK: ${{ secrets.SLACK }}
78-
79-
- name: notify slack on success
80-
if: success()
81-
run: |
82-
curl -X POST -H 'Content-type: application/json' --data '{"text":":dance: Successfully published a new version of ${{ github.event.inputs.package }}"}' $SLACK_WEBHOOK
83-
env:
84-
SLACK_WEBHOOK: ${{ secrets.SLACK }}
85-
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
registry: "https://npm.pkg.github.com"

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
runs-on: [ubuntu-latest, macos-latest-large, windows-latest]
19+
runs-on: [ubuntu-latest]
2020

2121
# Node 18 is the current default Node version in hosted runners, so users may still use the toolkit with it when running tests (see https://github.com/actions/toolkit/issues/1841)
2222
# Node 20 is the currently support Node version for actions - https://docs.github.com/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#runsusing-for-javascript-actions

packages/cache/__tests__/saveCache.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ test('save with small cache outputs should fail on changed limit', async () => {
102102
expect(cacheId).toBe(-1)
103103
expect(logWarningMock).toHaveBeenCalledTimes(1)
104104
expect(logWarningMock).toHaveBeenCalledWith(
105-
'Failed to save: Cache size of ~1024 MB (1048576 B) is over the 100MB limit, not saving cache.'
105+
'Failed to save: Cache size of ~1024 MB (1073741824 B) is over the 100MB limit, not saving cache.'
106106
)
107107

108108
const archiveFolder = '/foo/bar'

0 commit comments

Comments
 (0)