Repository navigation
chore: adopt Changesets and rename the shared package to gcb-core #33
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5e74338
chore: adopt changesets and automated releases
JounQin 69a4904
ci: publish with npm trusted publishing
JounQin caeaddf
chore: address release review
JounQin 3fdabef
chore: simplify release scripts and image matrix
JounQin 9779e71
chore: lock the three package versions together
JounQin dccd3b1
refactor: rename the shared package to gcb-core
JounQin bdaea1b
docs: finish the core package rename in the workspace note
JounQin f22e656
fix: make the release workflow actually publish
JounQin 30a1599
docs: publish images to GHCR only
JounQin bc778bb
docs: separate local image tags from published ones
JounQin 440916b
test: pack package copies so prepack cannot touch the workspace
JounQin 61ad16c
test: reuse the spawn helper for isolated packing
JounQin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Changesets | ||
|
|
||
| Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a tool to manage versioning and changelogs. Read the full documentation at https://changesets.dev. | ||
|
|
||
| We also have a quick list of common questions to get you started engaging with this project in our [FAQ](https://changesets.dev/faq). |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "$schema": "https://unpkg.com/@changesets/config/schema.json", | ||
| "changelog": [ | ||
| "@changesets/changelog-github", | ||
| { | ||
| "repo": "code-vaults/git-credential-broker" | ||
| } | ||
| ], | ||
| "access": "public", | ||
| "baseBranch": "main", | ||
| "updateInternalDependencies": "patch", | ||
| "fixed": [ | ||
| [ | ||
| "gcb-core", | ||
| "gcb-client", | ||
| "gcb-host" | ||
| ] | ||
| ] | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| 'gcb-core': patch | ||
| 'gcb-client': patch | ||
| 'gcb-host': patch | ||
| --- | ||
|
|
||
| Prepare the first public release of the renamed packages. |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| # A publish that has started has to finish: cancelling it can leave some packages on npm and the | ||
| # rest not. | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # `id-token` is npm trusted publishing; `contents` and `pull-requests` are the version commit | ||
| # and the release pull request. | ||
| contents: write | ||
| id-token: write | ||
| pull-requests: write | ||
| outputs: | ||
| version: ${{ steps.version.outputs.version }} | ||
| published: ${{ steps.changesets.outputs.published }} | ||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| # Changesets writes each changelog from the commits since the last release. | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | ||
| with: | ||
| node-version: lts/* | ||
| cache: yarn | ||
|
|
||
| - name: Enable Corepack | ||
| run: corepack enable | ||
|
|
||
| - name: Install Dependencies | ||
| run: yarn install --immutable | ||
|
|
||
| - name: Build | ||
| run: yarn build | ||
|
|
||
| - name: Read the package version | ||
| id: version | ||
| run: echo "version=$(jq -r .version packages/core/package.json)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Create Release Pull Request or Publish to npm | ||
| id: changesets | ||
| uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2 | ||
| with: | ||
| commit-message: 'chore: release packages' | ||
| pr-title: 'chore: release packages' | ||
| version-script: yarn run version | ||
| publish-script: yarn release | ||
|
|
||
| image: | ||
| name: Publish gcb-${{ matrix.target }} | ||
| needs: release | ||
| if: needs.release.outputs.published == 'true' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| target: [client, host] | ||
| steps: | ||
| - name: Checkout Repo | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup QEMU | ||
| uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 | ||
| with: | ||
| platforms: arm64 | ||
|
|
||
| - name: Setup Buildx | ||
| uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 | ||
|
|
||
| - name: Log in to GHCR | ||
| uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Work out the tags | ||
| id: tags | ||
| env: | ||
| VERSION: ${{ needs.release.outputs.version }} | ||
| IMAGE: gcb-${{ matrix.target }} | ||
| run: | | ||
| { | ||
| echo "ghcr.io/code-vaults/$IMAGE:latest" | ||
| echo "ghcr.io/code-vaults/$IMAGE:sha-${GITHUB_SHA}" | ||
| echo "ghcr.io/code-vaults/$IMAGE:${VERSION}" | ||
| } > "$RUNNER_TEMP/tags" | ||
| { | ||
| echo 'tags<<TAGS' | ||
| cat "$RUNNER_TEMP/tags" | ||
| echo 'TAGS' | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Build and push | ||
|
JounQin marked this conversation as resolved.
Resolved
|
||
| uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 | ||
| with: | ||
| context: . | ||
| target: ${{ matrix.target }} | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ${{ steps.tags.outputs.tags }} | ||
| labels: | | ||
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
| org.opencontainers.image.version=${{ needs.release.outputs.version }} | ||
| org.opencontainers.image.title=gcb-${{ matrix.target }} | ||
| provenance: true | ||
| sbom: true | ||
| cache-from: type=gha,scope=${{ matrix.target }} | ||
| cache-to: type=gha,mode=max,scope=${{ matrix.target }} | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.