Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spruce release workflows #131

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Spruce release workflows #131

merged 1 commit into from
Oct 3, 2023

Conversation

jhamon
Copy link
Collaborator

@jhamon jhamon commented Oct 3, 2023

Problem

We need a way to ship builds of the spruce branch.

Solution

Copy & modify the existing release process for shipping dev builds of main using the @next tag.

In these new workflows, we will use the npm tag @spruce and @spruceDev.

  • @spruce releases are for use in 3rd party testing
  • @spruceDev releases are for use in internal testing

Type of Change

  • Infrastructure change (CI configs, etc)

@jhamon jhamon marked this pull request as ready for review October 3, 2023 18:34
run: |
currentVersion=$(jq -r '.version' package.json)
timestamp=$(date +%Y%m%d%H%M%S)
devVersion="$currentVersion-spruceDev.$timestamp"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devVersion string changed to reflect spruceDev

- name: Checkout
uses: actions/checkout@v4
with:
ref: spruce
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build the spruce branch

jq --null-input --arg version "$devVersion" '{"name": "@pinecone-database/pinecone", "version": $version}' > src/version.json

- name: 'Publish to npm'
run: npm publish --tag spruceDev
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publish with spruceDev tag.

jq --null-input --arg version "$devVersion" '{"name": "@pinecone-database/pinecone", "version": $version}' > src/version.json

- name: 'Publish to npm'
run: npm publish --tag spruce
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release with spruce tag

run: |
currentVersion=$(jq -r '.version' package.json)
timestamp=$(date +%Y%m%d%H%M%S)
devVersion="$currentVersion-spruce.$timestamp"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devVersion string updated to have spruce identifier

- name: Checkout
uses: actions/checkout@v4
with:
ref: spruce
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build spruce branch

name: 'Release: @spruce build'

on:
workflow_dispatch: {}
Copy link
Collaborator Author

@jhamon jhamon Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only run when manually triggered. Since there are no automatic builds of this job, we can remove the steps that checked whether there are any recent changes (designed to prevent cluttering up npm with a lot of identical builds).

on:
workflow_dispatch: {}
schedule:
- cron: '0 0 * * *'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run every night, or when manually triggered

Copy link
Contributor

@austin-denoble austin-denoble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Good thinking splitting out dev vs. 3rd party concerns in this way. 🚢

@jhamon jhamon merged commit 9fd3ca9 into main Oct 3, 2023
18 checks passed
@jhamon jhamon deleted the jhamon/spruce-release branch October 3, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants