diff --git a/.changeset/grumpy-garlics-sell.md b/.changeset/grumpy-garlics-sell.md new file mode 100644 index 000000000..e8e9304a3 --- /dev/null +++ b/.changeset/grumpy-garlics-sell.md @@ -0,0 +1,5 @@ +--- +'@openproject/octicons': patch +--- + +fix: publish built angular package instead of source diff --git a/.github/actions/build_angular/Dockerfile b/.github/actions/build_angular/Dockerfile new file mode 100644 index 000000000..358000732 --- /dev/null +++ b/.github/actions/build_angular/Dockerfile @@ -0,0 +1,10 @@ +FROM node:18-slim + +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + jq && \ + apt-get clean -y && \ + rm -rf /var/lib/apt/lists/* + +ADD entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/build_angular/entrypoint.sh b/.github/actions/build_angular/entrypoint.sh new file mode 100755 index 000000000..f7a522a4a --- /dev/null +++ b/.github/actions/build_angular/entrypoint.sh @@ -0,0 +1,37 @@ +#!/bin/bash -l + +set -e + +printf "//registry.npmjs.org/:_authToken=%s" "$NPM_AUTH_TOKEN_SHARED" > "$HOME/.npmrc" + +PACKAGE_VERSION=$(jq '.version' --raw-output ./package.json) + +echo "************* Building v$PACKAGE_VERSION *************" + +PUBLISH_TAG=latest +if [[ "$PACKAGE_VERSION" =~ ^0\.0\.0\- ]] +then + PUBLISH_TAG=canary +elif [[ "$PACKAGE_VERSION" =~ \-rc ]] +then + PUBLISH_TAG=next +fi + +cd ./lib/$* + +echo "**************** Copying assets files to build directory ****************" +cp -R ../build/ . + +echo "**************** Installing ****************" +npm ci + +echo "**************** Building ****************" +npm run build + +{ + echo "**************** Publishing ****************" + cd dist/octicons-angular && npm version --allow-same-version $PACKAGE_VERSION && npm publish --tag $PUBLISH_TAG --access public +} || { + # Bail out of publishing + exit 0 +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4b3325cd4..e3356cd85 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -66,7 +66,7 @@ jobs: with: name: octicons path: ./lib/build - - uses: ./.github/actions/build_node + - uses: ./.github/actions/build_angular env: NPM_AUTH_TOKEN_SHARED: ${{ secrets.NPM_AUTH_TOKEN_SHARED }} with: diff --git a/lib/octicons_angular/package.json b/lib/octicons_angular/package.json index 6ae9ef2bb..476377bcc 100644 --- a/lib/octicons_angular/package.json +++ b/lib/octicons_angular/package.json @@ -9,7 +9,6 @@ "test": "echo 'No tests specified for @openproject/octicons-angular' && exit 0", "watch": "script/build.js && ng build --watch --configuration development" }, - "private": false, "peerDependencies": { "@angular/common": "^16.1.0", "@angular/compiler": "^16.1.0",