Bringing local and remote repository in line with one another again
This commit is contained in:
parent
bc581f9eac
commit
332e177f99
15 changed files with 1344 additions and 222 deletions
53
.github/workflows/publish.yml
vendored
53
.github/workflows/publish.yml
vendored
|
|
@ -18,6 +18,10 @@ jobs:
|
|||
- name: Set up NPM Auth Token
|
||||
run: echo "NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
|
||||
|
||||
# Set up NPM Auth Token
|
||||
- name: Set up NPM Auth Token
|
||||
run: echo "NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
|
||||
|
||||
# Set up Node.js
|
||||
- name: Set up Node.js version
|
||||
uses: actions/setup-node@v3
|
||||
|
|
@ -42,12 +46,53 @@ jobs:
|
|||
# > Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).
|
||||
scope: '@BridgemanAccessible'
|
||||
|
||||
# Install dependencies
|
||||
- name: Install dependencies
|
||||
# Transpile/Build the package (TypeScript -> JavaScript)
|
||||
- name: Transpile/Build the package (TypeScript -> JavaScript)
|
||||
run: |
|
||||
# Install needed dependencies
|
||||
yarn install
|
||||
|
||||
# Build the package
|
||||
yarn build
|
||||
|
||||
- name: Determine Version and Increment (if needed)
|
||||
id: version_check
|
||||
run: |
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
echo "Version: $VERSION"
|
||||
|
||||
NAME=$(node -p "require('./package.json').name")
|
||||
LATEST_VERSION=$(npm show $NAME version --registry https://npm.pkg.bridgemanaccessible.ca)
|
||||
echo "Latest version: $LATEST_VERSION"
|
||||
|
||||
if [ "$LATEST_VERSION" != "$VERSION" ]; then
|
||||
echo "Manually updated version detected: $VERSION"
|
||||
else
|
||||
NEW_VERSION=$(npm version patch --no-git-tag-version)
|
||||
echo "New version: $NEW_VERSION"
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
|
||||
echo "version_changed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit Version Change (if needed)
|
||||
if: steps.version_check.outputs.version_changed == 'true'
|
||||
run: |
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git add package.json
|
||||
git commit -m "[Github Actions] Update version to ${{ env.new_version }}"
|
||||
git push origin HEAD:main
|
||||
|
||||
# Publish to private NPM registry
|
||||
- name: Publish package
|
||||
run: npm publish
|
||||
- name: Publish the package
|
||||
run: |
|
||||
# Copy over the files to the build output (`dist`) folder
|
||||
cp package.json dist/package.json
|
||||
cp README.md dist/README.md
|
||||
cp LICENSE dist/LICENSE
|
||||
|
||||
# Change directory to the build output (`dist`) folder
|
||||
cd dist
|
||||
|
||||
# Publish the package to the private NPM registry
|
||||
npm publish --registry http://npm.pkg.bridgemanaccessible.ca/
|
||||
Loading…
Add table
Add a link
Reference in a new issue