Skip to content

Commit

Permalink
test autotagger
Browse files Browse the repository at this point in the history
  • Loading branch information
warm-coolguy committed Feb 2, 2024
1 parent 4e1a4a5 commit 472c464
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@ jobs:
node-version: 18.13.0
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run publishPackages
- run: TAGS=$(node ./scripts/publishPackages)
- run: echo "$TAGS"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: EndBug/add-and-commit@v9
with:
author_name: Dataport Geo Bot
author_email: [email protected]
- run: |
git config user.name "Dataport Geo Bot"
git config user.email "[email protected]"
for TAG_NAME in $TAGS; do
git tag $TAG_NAME
git push origin $TAG_NAME
echo "Released and tagged: $TAG_NAME"
done
Binary file added .hack.sh.swp
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/lib/createTestMountParameters/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGELOG

## 1.3.0-mock-release-for-testing-pipeline.0

## 1.2.0

- Feature: Extend mock state to match current core state type.
Expand Down
15 changes: 12 additions & 3 deletions scripts/publishPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const cp = require('child_process')
const fs = require('fs')
const packages = require('./packages')

const tags = []

function checkForNewVersion(cwd) {
const { version } = JSON.parse(
fs.readFileSync(cwd + '/package.json', { encoding: 'UTF-8' })
Expand All @@ -18,6 +20,13 @@ function checkForNewVersion(cwd) {
}
}

function getPackageName(cwd) {
const { name } = JSON.parse(
fs.readFileSync(cwd + '/package.json', { encoding: 'UTF-8' })
)
return name
}

for (const path of packages) {
try {
const nextVersion = checkForNewVersion(path)
Expand All @@ -30,12 +39,12 @@ for (const path of packages) {
{ cwd: path }
)
cp.execSync('npm publish --access=public', context)
console.info(`The package in '${path}' was published as v${nextVersion}.`)
} else {
console.info("No update in '" + path + "'.")
tags.push(`${getPackageName(path)}@${nextVersion}`)
}
} catch (e) {
console.error(e)
process.exitCode = 1
}
}

process.stdout.write(tags.join(' '))

0 comments on commit 472c464

Please sign in to comment.