Bump package versions to 0.1.1 and update npm publish workflow with registry authentication
This commit is contained in:
1 parent
da1cdca3b2
commit
ce6db8a457
6 files changed
+41
-14
No files matched your search
@@ -50,17 +50,44 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish npm packages
|
- name: Publish npm packages
|
||||||
env:
|
env:
|
||||||
|
PACKAGE_REGISTRY_USERNAME: ${{ secrets.PACKAGE_REGISTRY_USERNAME }}
|
||||||
|
PACKAGE_REGISTRY_TOKEN: ${{ secrets.PACKAGE_REGISTRY_TOKEN }}
|
||||||
NPM_REGISTRY: https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/
|
NPM_REGISTRY: https://repos.gfranz.ch/api/packages/Gabriel20xx/npm/
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
if [ -z "$PACKAGE_REGISTRY_USERNAME" ] || [ -z "$PACKAGE_REGISTRY_TOKEN" ]; then
|
||||||
|
echo 'PACKAGE_REGISTRY_USERNAME and PACKAGE_REGISTRY_TOKEN secrets are required.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
for package in \
|
for package in \
|
||||||
@gabriel20xx/design-tokens \
|
@gabriel20xx/design-tokens \
|
||||||
@gabriel20xx/web-ui \
|
@gabriel20xx/web-ui \
|
||||||
@gabriel20xx/node-backend; do
|
@gabriel20xx/node-backend; do
|
||||||
version="$(npm pkg get version --workspace="$package" | tr -d '"[:space:]')"
|
version="$(npm pkg get version --workspace="$package" | tr -d '"[:space:]')"
|
||||||
if npm view "$package@$version" version --registry="$NPM_REGISTRY" >/dev/null 2>&1; then
|
package_path="${package//@/%40}"
|
||||||
|
package_path="${package_path//\//%2f}"
|
||||||
|
metadata_file="$(mktemp)"
|
||||||
|
metadata_status="$(curl --silent --show-error --fail-with-body \
|
||||||
|
--user "$PACKAGE_REGISTRY_USERNAME:$PACKAGE_REGISTRY_TOKEN" \
|
||||||
|
--output "$metadata_file" \
|
||||||
|
--write-out '%{http_code}' \
|
||||||
|
"${NPM_REGISTRY}${package_path}" || true)"
|
||||||
|
case "$metadata_status" in
|
||||||
|
200)
|
||||||
|
if grep -Fq "\"$version\"" "$metadata_file"; then
|
||||||
echo "$package@$version is already published; skipping."
|
echo "$package@$version is already published; skipping."
|
||||||
else
|
rm -f "$metadata_file"
|
||||||
npm publish --workspace="$package" --registry="$NPM_REGISTRY"
|
continue
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
404)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
cat "$metadata_file" >&2
|
||||||
|
echo "Gitea npm metadata lookup failed with HTTP status $metadata_status." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
npm publish --workspace="$package" --registry="$NPM_REGISTRY"
|
||||||
|
rm -f "$metadata_file"
|
||||||
done
|
done
|
||||||
Generated
+6
-6
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@gabriel20xx/shared-code",
|
"name": "@gabriel20xx/shared-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@gabriel20xx/shared-code",
|
"name": "@gabriel20xx/shared-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
@@ -3113,12 +3113,12 @@
|
|||||||
},
|
},
|
||||||
"packages/design-tokens": {
|
"packages/design-tokens": {
|
||||||
"name": "@gabriel20xx/design-tokens",
|
"name": "@gabriel20xx/design-tokens",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"packages/node-backend": {
|
"packages/node-backend": {
|
||||||
"name": "@gabriel20xx/node-backend",
|
"name": "@gabriel20xx/node-backend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pg": "^8.17.2"
|
"pg": "^8.17.2"
|
||||||
@@ -3129,10 +3129,10 @@
|
|||||||
},
|
},
|
||||||
"packages/web-ui": {
|
"packages/web-ui": {
|
||||||
"name": "@gabriel20xx/web-ui",
|
"name": "@gabriel20xx/web-ui",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gabriel20xx/design-tokens": "0.1.0"
|
"@gabriel20xx/design-tokens": "0.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/package": "^2.5.0",
|
"@sveltejs/package": "^2.5.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gabriel20xx/shared-code",
|
"name": "@gabriel20xx/shared-code",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Shared UI and backend packages for Gabriel20xx projects.",
|
"description": "Shared UI and backend packages for Gabriel20xx projects.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gabriel20xx/design-tokens",
|
"name": "@gabriel20xx/design-tokens",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Shared visual tokens for Gabriel20xx web projects.",
|
"description": "Shared visual tokens for Gabriel20xx web projects.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gabriel20xx/node-backend",
|
"name": "@gabriel20xx/node-backend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Shared PostgreSQL, configuration, migration, and authentication primitives for Node.js services.",
|
"description": "Shared PostgreSQL, configuration, migration, and authentication primitives for Node.js services.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gabriel20xx/web-ui",
|
"name": "@gabriel20xx/web-ui",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Shared Svelte UI, layout, authentication, and account components for Gabriel20xx web projects.",
|
"description": "Shared Svelte UI, layout, authentication, and account components for Gabriel20xx web projects.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"svelte": "^5.0.0"
|
"svelte": "^5.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gabriel20xx/design-tokens": "0.1.0"
|
"@gabriel20xx/design-tokens": "0.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/package": "^2.5.0",
|
"@sveltejs/package": "^2.5.0",
|
||||||
|
|||||||
Reference in new issue
Block a user