Release: @next nightly dev build #572
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Release: @next nightly dev build' | ||
on: | ||
workflow_dispatch: {} | ||
schedule: | ||
- cron: '0 0 * * *' | ||
jobs: | ||
testing: | ||
uses: './.github/workflows/testing.yml' | ||
Check failure on line 10 in .github/workflows/release-dev.yml GitHub Actions / Release: @next nightly dev buildInvalid workflow file
|
||
secrets: inherit | ||
version-and-release: | ||
name: Release dev build to NPM | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup | ||
uses: ./.github/actions/setup | ||
- name: Get recent changes | ||
id: list-commits | ||
run: | | ||
recentCommits=$(git log --since=yesterday --oneline) | ||
echo "commits=$recentCommits" >> "$GITHUB_OUTPUT" | ||
- name: Abort if no recent changes | ||
if: steps.list-commits.outputs.commits == '' | ||
uses: andymckay/[email protected] | ||
- name: 'Bump version, do not commit' | ||
shell: bash | ||
run: | | ||
currentVersion=$(jq -r '.version' package.json) | ||
timestamp=$(date +%Y%m%d%H%M%S) | ||
devVersion="$currentVersion-dev.$timestamp" | ||
jq --arg newVersion "$devVersion" '.version = $newVersion' package.json > package.tmp && mv package.tmp package.json | ||
jq --arg newVersion "$devVersion" '.version = $newVersion' package-lock.json > package-lock.tmp && mv package-lock.tmp package-lock.json | ||
jq --arg newVersion "$devVersion" '.packages[""].version = $newVersion' package-lock.json > package-lock.tmp && mv package-lock.tmp package-lock.json | ||
jq --null-input --arg version "$devVersion" '{"name": "@pinecone-database/pinecone", "version": $version}' > src/version.json | ||
- name: 'Publish to npm' | ||
run: npm publish --tag next | ||
shell: bash | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |