From a67f1606e5c23ac8b9a98fd3bdc5a733c86e4911 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Fri, 24 May 2024 17:46:00 +1000 Subject: [PATCH 1/4] init covector --- .changes/config.json | 36 +++++++++++++ .changes/readme.md | 31 ++++++++++++ .github/workflows/covector-status.yml | 16 ++++++ .../workflows/covector-version-or-publish.yml | 50 +++++++++++++++++++ 4 files changed, 133 insertions(+) create mode 100644 .changes/config.json create mode 100644 .changes/readme.md create mode 100644 .github/workflows/covector-status.yml create mode 100644 .github/workflows/covector-version-or-publish.yml diff --git a/.changes/config.json b/.changes/config.json new file mode 100644 index 0000000..7b28dd8 --- /dev/null +++ b/.changes/config.json @@ -0,0 +1,36 @@ +{ + "gitSiteUrl": "https://github.com/andogq/qubit/", + "pkgManagers": { + "javascript": { + "version": true, + "getPublishedVersion": "npm view ${ pkgFile.pkg.name } version", + "publish": [ + "npm publish --access public" + ] + }, + "rust": { + "version": true, + "getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p'", + "publish": [ + "cargo publish" + ] + } + }, + "packages": { + "@qubit-rs/client": { + "path": "./packages/client", + "manager": "javascript" + }, + "qubit": { + "path": ".", + "manager": "rust", + "dependencies": [ + "qubit-macros" + ] + }, + "qubit-macros": { + "path": "./crates/qubit-macros", + "manager": "rust" + } + } +} diff --git a/.changes/readme.md b/.changes/readme.md new file mode 100644 index 0000000..5c2b35e --- /dev/null +++ b/.changes/readme.md @@ -0,0 +1,31 @@ +# Changes + +##### via https://github.com/jbolda/covector + +As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes. + +When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process. + +Use the following format: + +```md +--- +"package-a": patch +"package-b": minor +--- + +Change summary goes here + +``` + +Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed. + +Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/). + +Given a version number MAJOR.MINOR.PATCH, increment the: + +- MAJOR version when you make incompatible API changes, +- MINOR version when you add functionality in a backwards compatible manner, and +- PATCH version when you make backwards compatible bug fixes. + +Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing). diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml new file mode 100644 index 0000000..ac7c706 --- /dev/null +++ b/.github/workflows/covector-status.yml @@ -0,0 +1,16 @@ +name: covector status +on: [pull_request] + +jobs: + covector: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # required for use of git history + - name: covector status + uses: jbolda/covector/packages/action@covector-v0.10 + id: covector + with: + command: 'status' diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml new file mode 100644 index 0000000..ed5eaf7 --- /dev/null +++ b/.github/workflows/covector-version-or-publish.yml @@ -0,0 +1,50 @@ +name: version or publish + +on: + push: + branches: + - main + +jobs: + version-or-publish: + runs-on: ubuntu-latest + timeout-minutes: 65 + outputs: + change: ${{ steps.covector.outputs.change }} + commandRan: ${{ steps.covector.outputs.commandRan }} + successfulPublish: ${{ steps.covector.outputs.successfulPublish }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # required for use of git history + - uses: actions/setup-node@v3 + with: + node-version: 14 + registry-url: 'https://registry.npmjs.org' + - name: cargo login + run: cargo login ${{ secrets.crate_token }} + - name: git config + run: | + git config --global user.name "${{ github.event.pusher.name }}" + git config --global user.email "${{ github.event.pusher.email }}" + - name: covector version or publish (publish when no change files present) + uses: jbolda/covector/packages/action@covector-v0.10 + id: covector + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + command: 'version-or-publish' + createRelease: true + - name: Create Pull Request With Versions Bumped + id: cpr + uses: peter-evans/create-pull-request@v3 + if: steps.covector.outputs.commandRan == 'version' + with: + title: "Publish New Versions" + commit-message: "publish new versions" + labels: "version updates" + branch: "release" + body: ${{ steps.covector.outputs.change }} From 8af77ec1d90093945980c16b07581466de2ee7f0 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Fri, 24 May 2024 17:56:00 +1000 Subject: [PATCH 2/4] remove release-plz --- .github/workflows/release-plz.yml | 36 ------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/release-plz.yml diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml deleted file mode 100644 index a1ed742..0000000 --- a/.github/workflows/release-plz.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Release-plz - -permissions: - pull-requests: write - contents: write - -on: - push: - branches: - - main - -jobs: - release-plz: - name: Release-plz - runs-on: ubuntu-latest - steps: - - name: Generate GitHub token - uses: actions/create-github-app-token@v1 - id: generate-token - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From d3a32e57361e9b55b175643ff6d2dc2f91d0f8ac Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Fri, 24 May 2024 17:59:04 +1000 Subject: [PATCH 3/4] add git tags post publish --- .changes/config.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.changes/config.json b/.changes/config.json index 7b28dd8..8e75088 100644 --- a/.changes/config.json +++ b/.changes/config.json @@ -6,6 +6,11 @@ "getPublishedVersion": "npm view ${ pkgFile.pkg.name } version", "publish": [ "npm publish --access public" + ], + "postpublish": [ + "git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f", + "git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f", + "git push --tags -f" ] }, "rust": { @@ -13,6 +18,11 @@ "getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p'", "publish": [ "cargo publish" + ], + "postpublish": [ + "git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f", + "git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f", + "git push --tags -f" ] } }, From 27f16d426bd15b4fb7b683dc4d95e4bbed6fc0c9 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Fri, 24 May 2024 20:30:04 +1000 Subject: [PATCH 4/4] capitalize secret name --- .github/workflows/covector-version-or-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index ed5eaf7..2da7819 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -23,7 +23,7 @@ jobs: node-version: 14 registry-url: 'https://registry.npmjs.org' - name: cargo login - run: cargo login ${{ secrets.crate_token }} + run: cargo login ${{ secrets.CRATE_TOKEN }} - name: git config run: | git config --global user.name "${{ github.event.pusher.name }}"