From 339211b11a2223d8d9592fe0049815b2f9a69be6 Mon Sep 17 00:00:00 2001 From: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:09:50 -0800 Subject: [PATCH 01/22] Staging (#43) * added empty state text * update permission group in the dataset * Enhance dataset asset listing with organization-specific filtering - Updated the `list_assets` function to include organization ID filtering in dataset permissions queries. - Removed redundant organization ID filters from the dataset permissions queries to streamline the logic. - Ensured that only relevant dataset assets are returned based on the user's organization, improving data security and relevance. These changes enhance the API's ability to serve organization-specific data, aligning with recent improvements in dataset asset APIs. * containerized class should be white with no border at bottom * clear query when signing out * Use correct endpoint for dataset groups * yaml syntax highligting * create dataset endpoints * update disable logic for deploying a dataset * Refactor user routes to include new endpoint for retrieving user by ID - Removed the public modifier from `get_user` and `update_user` modules to encapsulate them within the module. - Added a new route to the user router for fetching a user by their ID, enhancing the API's functionality. - This change improves the user management capabilities by allowing retrieval of specific user details based on their unique identifier. * Add organizations module and integrate with user routes * remove unused imports and abstract variables * Refactor user update functionality to support role changes - Enhanced the `update_user` endpoint to accept and process user role updates alongside name changes. - Introduced a new `UserResponse` struct for improved response handling. - Updated the `update_user_handler` to handle changes in both user name and organization role, improving the flexibility of user management. - Adjusted response type to return no content upon successful updates, aligning with RESTful practices. These changes enhance the user management capabilities by allowing for more comprehensive updates to user information. * Update user route to use ID parameter for updates - Changed the user update route to require a user ID in the URL, enhancing RESTful practices. - Updated the `update_user` function to extract the user ID from the path, ensuring the correct user is updated based on the provided ID. These changes improve the clarity and functionality of the user update endpoint, aligning it with standard REST conventions. * simplify hooks imports * Remove unused component * restructure folders for layout * update imports for gloabl components * add additional routes * Implement user permission checks in dataset deployment and user update routes - Added permission validation to the `deploy_datasets` and `post_dataset` functions to ensure only users with workspace admin or data admin roles can execute these actions. - Enhanced error handling for permission checks, returning appropriate HTTP status codes and messages for insufficient permissions and internal errors. - Updated imports to include the new security checks module for consistency across routes. These changes improve security by enforcing role-based access control in critical dataset operations. * Refactor user update route to enhance RESTful practices - Updated the user update route to require a user ID in the URL, ensuring the correct user is updated based on the provided ID. - Improved clarity and functionality of the `update_user` function by extracting the user ID from the path. These changes align the user update endpoint with standard REST conventions, enhancing overall API usability. * Enhance dataset listing functionality with user organization roles - Refactored dataset listing logic to incorporate user organization roles, allowing for more granular access control based on user permissions. - Introduced new role checks for `WorkspaceAdmin`, `DataAdmin`, `Querier`, `RestrictedQuerier`, and `Viewer` to determine dataset visibility. - Updated database queries to fetch datasets based on user roles and organization associations, improving data retrieval efficiency. - Removed deprecated functions and streamlined the dataset fetching process, ensuring clarity and maintainability in the codebase. These changes improve the API's security and usability by enforcing role-based access control for dataset operations. * tweaked the post thread permissions handle. * permission_group string fix * remove package.json * fix: Add release please syntax handler and github action (#40) * fix(buster): Add release please syntax handler and github action * chore: add version tracking setup fix: update update nate rulez --------- Co-authored-by: dal --- .github/workflows/release-please.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 374fddd3f..1d6c9f97e 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -17,11 +17,6 @@ jobs: uses: googleapis/release-please-action@v4 with: release-type: simple - package-name: buster path: . - changelog-path: CHANGELOG.md - version-file: version.txt - bump-minor-pre-major: true - skip-github-release: true - skip-pull-requests: true token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + skip-github-release: true \ No newline at end of file From 9858249b9b79b7d641cdbfc2f8ab270e8e745cea Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 12:45:46 -0700 Subject: [PATCH 02/22] Update version.txt --- version.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/version.txt b/version.txt index e69de29bb..a4bdda4ce 100644 --- a/version.txt +++ b/version.txt @@ -0,0 +1,2 @@ +buster=0.0.1 +.=0.0.1 \ No newline at end of file From 2bc0dcd96099750b2140d886f9935d67d52b371d Mon Sep 17 00:00:00 2001 From: Nate Kelley <133379588+nate-kelley-buster@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:46:49 -0800 Subject: [PATCH 03/22] chore: Add additional semvar files (#44) * added empty state text * update permission group in the dataset * Enhance dataset asset listing with organization-specific filtering - Updated the `list_assets` function to include organization ID filtering in dataset permissions queries. - Removed redundant organization ID filters from the dataset permissions queries to streamline the logic. - Ensured that only relevant dataset assets are returned based on the user's organization, improving data security and relevance. These changes enhance the API's ability to serve organization-specific data, aligning with recent improvements in dataset asset APIs. * containerized class should be white with no border at bottom * clear query when signing out * Use correct endpoint for dataset groups * yaml syntax highligting * create dataset endpoints * update disable logic for deploying a dataset * Refactor user routes to include new endpoint for retrieving user by ID - Removed the public modifier from `get_user` and `update_user` modules to encapsulate them within the module. - Added a new route to the user router for fetching a user by their ID, enhancing the API's functionality. - This change improves the user management capabilities by allowing retrieval of specific user details based on their unique identifier. * Add organizations module and integrate with user routes * remove unused imports and abstract variables * Refactor user update functionality to support role changes - Enhanced the `update_user` endpoint to accept and process user role updates alongside name changes. - Introduced a new `UserResponse` struct for improved response handling. - Updated the `update_user_handler` to handle changes in both user name and organization role, improving the flexibility of user management. - Adjusted response type to return no content upon successful updates, aligning with RESTful practices. These changes enhance the user management capabilities by allowing for more comprehensive updates to user information. * Update user route to use ID parameter for updates - Changed the user update route to require a user ID in the URL, enhancing RESTful practices. - Updated the `update_user` function to extract the user ID from the path, ensuring the correct user is updated based on the provided ID. These changes improve the clarity and functionality of the user update endpoint, aligning it with standard REST conventions. * simplify hooks imports * Remove unused component * restructure folders for layout * update imports for gloabl components * add additional routes * Implement user permission checks in dataset deployment and user update routes - Added permission validation to the `deploy_datasets` and `post_dataset` functions to ensure only users with workspace admin or data admin roles can execute these actions. - Enhanced error handling for permission checks, returning appropriate HTTP status codes and messages for insufficient permissions and internal errors. - Updated imports to include the new security checks module for consistency across routes. These changes improve security by enforcing role-based access control in critical dataset operations. * Refactor user update route to enhance RESTful practices - Updated the user update route to require a user ID in the URL, ensuring the correct user is updated based on the provided ID. - Improved clarity and functionality of the `update_user` function by extracting the user ID from the path. These changes align the user update endpoint with standard REST conventions, enhancing overall API usability. * Enhance dataset listing functionality with user organization roles - Refactored dataset listing logic to incorporate user organization roles, allowing for more granular access control based on user permissions. - Introduced new role checks for `WorkspaceAdmin`, `DataAdmin`, `Querier`, `RestrictedQuerier`, and `Viewer` to determine dataset visibility. - Updated database queries to fetch datasets based on user roles and organization associations, improving data retrieval efficiency. - Removed deprecated functions and streamlined the dataset fetching process, ensuring clarity and maintainability in the codebase. These changes improve the API's security and usability by enforcing role-based access control for dataset operations. * tweaked the post thread permissions handle. * permission_group string fix * remove package.json * fix: Add release please syntax handler and github action (#40) * fix(buster): Add release please syntax handler and github action * chore: add version tracking setup fix: update update nate rulez * Update version.txt --------- Co-authored-by: dal --- version.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/version.txt b/version.txt index e69de29bb..a4bdda4ce 100644 --- a/version.txt +++ b/version.txt @@ -0,0 +1,2 @@ +buster=0.0.1 +.=0.0.1 \ No newline at end of file From 05202a3ddb4e415f9bd672e85530b798ff69cc1a Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 12:52:52 -0700 Subject: [PATCH 04/22] feat: update path to version file --- .github/workflows/release-please.yml | 6 ++++-- .gitignore | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 1d6c9f97e..52487cb00 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -17,6 +17,8 @@ jobs: uses: googleapis/release-please-action@v4 with: release-type: simple - path: . token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - skip-github-release: true \ No newline at end of file + skip-github-release: true + path: . + version-file: version.txt + depth: 20 diff --git a/.gitignore b/.gitignore index b79670cf7..1b162d40c 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,5 @@ Cargo.lock # Node.js dependencies node_modules/ + +.secrets \ No newline at end of file From da7f2a64eec298bca5a5ecb353bb5360fef8091c Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 13:01:37 -0700 Subject: [PATCH 05/22] chore: update invalid fields --- .github/workflows/release-please.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 52487cb00..ead070dac 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -20,5 +20,3 @@ jobs: token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} skip-github-release: true path: . - version-file: version.txt - depth: 20 From e8ee2ccac1b5a9eead3b2a485d1097bd3ecf89b8 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 13:10:58 -0700 Subject: [PATCH 06/22] fix: release please update --- .github/workflows/release-please.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index ead070dac..b9b8a8f86 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,22 +1,24 @@ -name: Release - on: push: branches: - main +permissions: + contents: write + pull-requests: write + +name: release-please + jobs: - release: + release-please: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Run Release Please - uses: googleapis/release-please-action@v4 + - uses: googleapis/release-please-action@v4 with: - release-type: simple + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - skip-github-release: true - path: . + # this is a built-in strategy in release-please, see "Action Inputs" + # for more options + release-type: simple \ No newline at end of file From 95e991b10b80ec003bc577e429932f4eb3bf2efa Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 13:49:28 -0700 Subject: [PATCH 07/22] chore: add release-please configuration --- .github/workflows/release-please.yml | 8 ++------ release-please-config.json | 13 +++++++++++++ release-please-manifest.json | 3 +++ 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 release-please-config.json create mode 100644 release-please-manifest.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index b9b8a8f86..695f6f939 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -15,10 +15,6 @@ jobs: steps: - uses: googleapis/release-please-action@v4 with: - # this assumes that you have created a personal access token - # (PAT) and configured it as a GitHub action secret named - # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - # this is a built-in strategy in release-please, see "Action Inputs" - # for more options - release-type: simple \ No newline at end of file + config-file: release-please-config.json + manifest-file: release-please-manifest.json \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..ae6106a77 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,13 @@ +{ + "packages": { + ".": { + "release-type": "simple", + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "draft": false, + "prerelease": false + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} diff --git a/release-please-manifest.json b/release-please-manifest.json new file mode 100644 index 000000000..b985ff6e7 --- /dev/null +++ b/release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} From 1c328a00371e32a7af361a790e074dd9c0e66cce Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 13:49:28 -0700 Subject: [PATCH 08/22] chore: add release-please configuration --- .github/workflows/release-please.yml | 24 -------------- .github/workflows/update-version.yml | 48 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/release-please.yml create mode 100644 .github/workflows/update-version.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index b9b8a8f86..000000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - push: - branches: - - main - -permissions: - contents: write - pull-requests: write - -name: release-please - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: googleapis/release-please-action@v4 - with: - # this assumes that you have created a personal access token - # (PAT) and configured it as a GitHub action secret named - # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). - token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - # this is a built-in strategy in release-please, see "Action Inputs" - # for more options - release-type: simple \ No newline at end of file diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 000000000..455bba3ef --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,48 @@ +name: Update Version + +on: + push: + branches: + - main + +jobs: + version: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + + - name: Get previous version + id: previous_version + run: | + VERSION=$(grep "buster=" version.txt | cut -d'=' -f2) + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Conventional Commit Check and Version Bump + id: version_bump + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + default_bump: false + dry_run: true + tag_prefix: "" + + - name: Update version.txt + if: steps.version_bump.outputs.new_version != steps.previous_version.outputs.version + run: | + NEW_VERSION="${{ steps.version_bump.outputs.new_version }}" + sed -i "s/buster=.*/buster=$NEW_VERSION/" version.txt + + - name: Commit and push if changed + if: steps.version_bump.outputs.new_version != steps.previous_version.outputs.version + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add version.txt + git commit -m "chore: bump version to ${{ steps.version_bump.outputs.new_version }}" + git push + From 9732dfd6b76b0124d42c48f7656329046ea6930f Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 14:05:23 -0700 Subject: [PATCH 09/22] fix(main): update release-please --- .github/workflows/release-please.yml | 18 +++++++++++++++++- release-please-manifest.json | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 695f6f939..e298aa7d0 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -14,7 +14,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: googleapis/release-please-action@v4 + id: release with: token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} config-file: release-please-config.json - manifest-file: release-please-manifest.json \ No newline at end of file + manifest-file: release-please-manifest.json + skip-github-pull-request: true + + - uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + + - name: Update version and push + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git add . + git commit -m "chore: update version to ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}" + git push + env: + GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} diff --git a/release-please-manifest.json b/release-please-manifest.json index b985ff6e7..40ff6fe0d 100644 --- a/release-please-manifest.json +++ b/release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "0.0.2" } From 7c26d63929e78fa4714cdadbe1ef87bd94388ac5 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 14:18:51 -0700 Subject: [PATCH 10/22] fix(main): this is a push to main to trigger a release --- .github/workflows/release-please.yml | 1 - .release-please-manifest.json | 3 +++ release-please-config.json | 5 +---- release-please-manifest.json | 3 --- version.txt | 2 -- 5 files changed, 4 insertions(+), 10 deletions(-) create mode 100644 .release-please-manifest.json delete mode 100644 release-please-manifest.json delete mode 100644 version.txt diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e298aa7d0..97e8c00cd 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -18,7 +18,6 @@ jobs: with: token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} config-file: release-please-config.json - manifest-file: release-please-manifest.json skip-github-pull-request: true - uses: actions/checkout@v4 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..b985ff6e7 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} diff --git a/release-please-config.json b/release-please-config.json index ae6106a77..b7d7be878 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -3,10 +3,7 @@ ".": { "release-type": "simple", "changelog-path": "CHANGELOG.md", - "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": true, - "draft": false, - "prerelease": false + "prerelease": true } }, "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" diff --git a/release-please-manifest.json b/release-please-manifest.json deleted file mode 100644 index 40ff6fe0d..000000000 --- a/release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "0.0.2" -} diff --git a/version.txt b/version.txt deleted file mode 100644 index a4bdda4ce..000000000 --- a/version.txt +++ /dev/null @@ -1,2 +0,0 @@ -buster=0.0.1 -.=0.0.1 \ No newline at end of file From 20ba771a8d5f7b7b8d3286da24bd8938c2db7837 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 14:25:24 -0700 Subject: [PATCH 11/22] fix: update README --- .github/workflows/release-please.yml | 4 +++- release-please-config.json => .release-please-config.json | 0 .release-please-manifest.json | 3 --- README.md | 2 +- version.txt | 1 + 5 files changed, 5 insertions(+), 5 deletions(-) rename release-please-config.json => .release-please-config.json (100%) delete mode 100644 .release-please-manifest.json create mode 100644 version.txt diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 97e8c00cd..0d1792b07 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -17,8 +17,10 @@ jobs: id: release with: token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - config-file: release-please-config.json skip-github-pull-request: true + release-type: simple + prerelease: true + version-file: version.txt - uses: actions/checkout@v4 if: ${{ steps.release.outputs.release_created }} diff --git a/release-please-config.json b/.release-please-config.json similarity index 100% rename from release-please-config.json rename to .release-please-config.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index b985ff6e7..000000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "0.0.1" -} diff --git a/README.md b/README.md index fccd5c4fc..352ae38ef 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@
- MIT License + MIT License Y Combinator W24
diff --git a/version.txt b/version.txt new file mode 100644 index 000000000..8a9ecc2ea --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file From 8a3a36e63bd3771cd005a64885ec101c00b9f642 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 14:48:17 -0700 Subject: [PATCH 12/22] fix: use a node pipeline --- .github/workflows/release-please.yml | 71 +++++++++++++++++++--------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 0d1792b07..4553dbbd2 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,37 +1,64 @@ +name: Update Version + on: push: branches: - main +# Add permissions configuration permissions: contents: write pull-requests: write -name: release-please - jobs: - release-please: + version-bump: runs-on: ubuntu-latest + steps: - - uses: googleapis/release-please-action@v4 - id: release + # Step 1: Check out the repository + - name: Checkout Code + uses: actions/checkout@v4 with: token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - skip-github-pull-request: true - release-type: simple - prerelease: true - version-file: version.txt - - - uses: actions/checkout@v4 - if: ${{ steps.release.outputs.release_created }} - - - name: Update version and push - if: ${{ steps.release.outputs.release_created }} + + # Step 2: Set up Node.js + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + # Step 3: Install Dependencies + - name: Install Dependencies + run: npm install standard-version --save-dev + + # Step 4: Determine New Version + - name: Determine Version + id: get_version run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git add . - git commit -m "chore: update version to ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}" - git push - env: - GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + # Read the current version + CURRENT_VERSION=$(cat version.txt) + echo "Current Version: $CURRENT_VERSION" + + # Get the next version using standard-version + NEW_VERSION=$(npx standard-version --dry-run | grep "tagging release" | awk '{print $NF}') + echo "New Version: $NEW_VERSION" + + # Export both versions for later steps + echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + # Step 5: Update version.txt if version changes + - name: Update version.txt + if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + run: | + echo "$NEW_VERSION" > version.txt + + # Step 6: Commit and Push Changes + - name: Commit and Push Changes + if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add version.txt + git commit -m "chore(release): update version to $NEW_VERSION" + git push "https://${{ github.actor }}:${{ secrets.MY_RELEASE_PLEASE_TOKEN }}@github.com/${{ github.repository }}.git" HEAD:main \ No newline at end of file From 75841b1c73bd03c2e26ebd83946934b50fb642a4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jan 2025 21:50:46 +0000 Subject: [PATCH 13/22] chore(release): update version to --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 8a9ecc2ea..8b1378917 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.1 \ No newline at end of file + From 6a67afe5cbfc7581b0f340a92831b371278aa72c Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 14:48:17 -0700 Subject: [PATCH 14/22] fix: use a node pipeline --- .github/workflows/release-please.yml | 83 ++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 0d1792b07..7da0ba582 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,37 +1,76 @@ +name: Update Version + on: push: branches: - main +# Add permissions configuration permissions: contents: write pull-requests: write -name: release-please - jobs: - release-please: + version-bump: runs-on: ubuntu-latest + steps: - - uses: googleapis/release-please-action@v4 - id: release + # Step 1: Check out the repository + - name: Checkout Code + uses: actions/checkout@v4 with: + fetch-depth: 0 # Fetch all history token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - skip-github-pull-request: true - release-type: simple - prerelease: true - version-file: version.txt - - - uses: actions/checkout@v4 - if: ${{ steps.release.outputs.release_created }} - - - name: Update version and push - if: ${{ steps.release.outputs.release_created }} + + # Step 2: Set up Node.js + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + # Step 3: Install Dependencies + - name: Install Dependencies + run: npm install standard-version --save-dev + + # Step 4: Determine New Version + - name: Determine Version + id: get_version run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git add . - git commit -m "chore: update version to ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}" - git push - env: - GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + # Debug: List directory contents + echo "Listing directory contents:" + ls -la + + # Debug: Check if version.txt exists + if [ -f "version.txt" ]; then + echo "version.txt exists" + else + echo "version.txt does not exist" + fi + + # Read the current version + CURRENT_VERSION=$(cat version.txt) + echo "Current Version: $CURRENT_VERSION" + + # Get the next version using standard-version + NEW_VERSION=$(npx standard-version --dry-run | grep "tagging release" | awk '{print $NF}') + echo "New Version: $NEW_VERSION" + + # Export both versions for later steps + echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + # Step 5: Update version.txt if version changes + - name: Update version.txt + if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + run: | + echo "$NEW_VERSION" > version.txt + + # Step 6: Commit and Push Changes + - name: Commit and Push Changes + if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add version.txt + git commit -m "chore(release): update version to $NEW_VERSION" + git push "https://${{ github.actor }}:${{ secrets.MY_RELEASE_PLEASE_TOKEN }}@github.com/${{ github.repository }}.git" HEAD:main \ No newline at end of file From d6e6f41165385f00808ec7a1f0214c65f88d4f3c Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 14:54:51 -0700 Subject: [PATCH 15/22] fix: update the prerelease logic --- .github/workflows/release-please.yml | 7 ++++--- version.txt | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 7da0ba582..ed6986c2b 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -43,6 +43,8 @@ jobs: # Debug: Check if version.txt exists if [ -f "version.txt" ]; then echo "version.txt exists" + echo "Current content of version.txt:" + cat version.txt else echo "version.txt does not exist" fi @@ -58,16 +60,15 @@ jobs: # Export both versions for later steps echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - # Step 5: Update version.txt if version changes - name: Update version.txt - if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + if: env.CURRENT_VERSION && env.CURRENT_VERSION != env.NEW_VERSION # Run only if version exists and versions are different run: | echo "$NEW_VERSION" > version.txt # Step 6: Commit and Push Changes - name: Commit and Push Changes - if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + if: env.CURRENT_VERSION && env.CURRENT_VERSION != env.NEW_VERSION # Run only if version exists and versions are different run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" diff --git a/version.txt b/version.txt index 8b1378917..8acdd82b7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ - +0.0.1 From 7cf0645ce98e0871a3fbd2fcd86992cc04df57af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jan 2025 21:58:51 +0000 Subject: [PATCH 16/22] chore(release): update version to --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 8acdd82b7..8b1378917 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.1 + From 3016e16afbcd3199965e6d1395a360d7ff8652d0 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 14:54:51 -0700 Subject: [PATCH 17/22] fix: update the prerelease logic --- .github/workflows/release-please.yml | 50 +++++++++++----------------- version.txt | 2 +- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 7da0ba582..c84584472 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -22,52 +22,42 @@ jobs: fetch-depth: 0 # Fetch all history token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} - # Step 2: Set up Node.js - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '20' - - # Step 3: Install Dependencies - - name: Install Dependencies - run: npm install standard-version --save-dev - - # Step 4: Determine New Version + # Step 2: Determine Version - name: Determine Version id: get_version run: | - # Debug: List directory contents - echo "Listing directory contents:" - ls -la - - # Debug: Check if version.txt exists - if [ -f "version.txt" ]; then - echo "version.txt exists" - else - echo "version.txt does not exist" + if [ ! -f "version.txt" ]; then + echo "0.0.1" > version.txt fi - # Read the current version CURRENT_VERSION=$(cat version.txt) echo "Current Version: $CURRENT_VERSION" - - # Get the next version using standard-version - NEW_VERSION=$(npx standard-version --dry-run | grep "tagging release" | awk '{print $NF}') + + # Split version into components + IFS='.' read -r -a version_parts <<< "$CURRENT_VERSION" + MAJOR="${version_parts[0]}" + MINOR="${version_parts[1]}" + PATCH="${version_parts[2]}" + + # Increment patch version + NEW_PATCH=$((PATCH + 1)) + NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" + echo "New Version: $NEW_VERSION" - - # Export both versions for later steps + + # Export versions for later steps echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - # Step 5: Update version.txt if version changes + # Step 3: Update version.txt if version changes - name: Update version.txt - if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + if: env.CURRENT_VERSION != env.NEW_VERSION run: | echo "$NEW_VERSION" > version.txt - # Step 6: Commit and Push Changes + # Step 4: Commit and Push Changes - name: Commit and Push Changes - if: env.CURRENT_VERSION != env.NEW_VERSION # Run only if the versions are different + if: env.CURRENT_VERSION != env.NEW_VERSION run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" diff --git a/version.txt b/version.txt index 8b1378917..8acdd82b7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ - +0.0.1 From e31f702c281c6a5249500e6aac585f2f99129e6d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jan 2025 22:06:06 +0000 Subject: [PATCH 18/22] chore(release): update version to 0.0.2 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 8acdd82b7..4e379d2bf 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.1 +0.0.2 From 7caaa97f171b15c314e8db3e49edbac9113d2707 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jan 2025 22:06:18 +0000 Subject: [PATCH 19/22] chore(release): update version to 0.0.3 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 4e379d2bf..bcab45af1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.2 +0.0.3 From df8940fd0b85b370c8294dd1ebba83e1b19d90e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jan 2025 22:06:29 +0000 Subject: [PATCH 20/22] chore(release): update version to 0.0.4 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index bcab45af1..81340c7e7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.3 +0.0.4 From 928d1c34af94f0008b0aaf62527b32c4a1ce4b5d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jan 2025 22:06:40 +0000 Subject: [PATCH 21/22] chore(release): update version to 0.0.5 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 81340c7e7..bbdeab622 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.0.4 +0.0.5 From 5b0e22173851fe7df4e81afc5bea811ae1f01fc1 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 16 Jan 2025 15:08:47 -0700 Subject: [PATCH 22/22] fix: stablize versioning --- .github/workflows/release-please.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index c84584472..60759225a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -13,6 +13,9 @@ permissions: jobs: version-bump: runs-on: ubuntu-latest + + # Add condition to skip if last commit was a release + if: "!startsWith(github.event.head_commit.message, 'chore(release)')" steps: # Step 1: Check out the repository