diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index 22f55a0e1b..53d14ad403 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -3,6 +3,10 @@ name: Continuous Deployment on: + pull_request: + paths: + - .github/workflows/npm-cd.yml + - .github/workflows/build-node-wrapper/action.yml push: tags: - "v*.*" @@ -68,7 +72,13 @@ jobs: scope: "${{ vars.NPM_SCOPE }}" always-auth: true token: ${{ secrets.NPM_AUTH_TOKEN }} - + + - name: Update package version in config.toml + uses: ./.github/workflows/update-glide-version + with: + folder_path: "${{ github.workspace }}/node/rust-client/.cargo" + named_os: ${{ matrix.build.NAMED_OS }} + - name: Build Node wrapper if: matrix.build.NPM_PUBLISH == true uses: ./.github/workflows/build-node-wrapper @@ -82,7 +92,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Publish to NPM - if: matrix.build.NPM_PUBLISH == true + if: matrix.build.NPM_PUBLISH == true && ${{ github.event_name != 'pull_request' }} shell: bash working-directory: ./node run: | @@ -190,6 +200,7 @@ jobs: done - name: Publish the base package + if: ${{ github.event_name != 'pull_request' }} shell: bash working-directory: ./node/npm/glide run: | diff --git a/.github/workflows/pypi-cd.yml b/.github/workflows/pypi-cd.yml index 56e407b89d..43700971d5 100644 --- a/.github/workflows/pypi-cd.yml +++ b/.github/workflows/pypi-cd.yml @@ -3,6 +3,10 @@ name: Continuous Deployment on: + pull_request: + paths: + - .github/workflows/pypi-cd.yml + - .github/workflows/build-python-wrapper/action.yml push: tags: - "v*.*" @@ -85,6 +89,12 @@ jobs: sudo apt upgrade -y sudo apt install python3 python3-venv python3-pip -y + - name: Update package version in config.toml + uses: ./.github/workflows/update-glide-version + with: + folder_path: "${{ github.workspace }}/python/.cargo" + named_os: ${{ matrix.build.NAMED_OS }} + - name: Build Python wrapper if: matrix.build.PYPI_PUBLISH == true uses: ./.github/workflows/build-python-wrapper @@ -104,7 +114,7 @@ jobs: cat .gitignore - name: Build Python wheels (linux) - if: matrix.build.PYPI_PUBLISH == true && startsWith(matrix.build.NAMED_OS, 'linux') + if: matrix.build.PYPI_PUBLISH == true && startsWith(matrix.build.NAMED_OS, 'linux') && ${{ github.event_name != 'pull_request' }} uses: PyO3/maturin-action@v1 with: working-directory: ./python @@ -125,7 +135,7 @@ jobs: fi - name: Build Python wheels (macos) - if: matrix.build.PYPI_PUBLISH == true && startsWith(matrix.build.NAMED_OS, 'darwin') + if: matrix.build.PYPI_PUBLISH == true && startsWith(matrix.build.NAMED_OS, 'darwin') && ${{ github.event_name != 'pull_request' }} uses: PyO3/maturin-action@v1 with: working-directory: ./python @@ -141,6 +151,7 @@ jobs: if-no-files-found: error publish-to-pypi: + if: ${{ github.event_name != 'pull_request' }} name: Publish the base PyPi package runs-on: ubuntu-latest needs: publish-binaries diff --git a/.github/workflows/update-glide-version/action.yml b/.github/workflows/update-glide-version/action.yml new file mode 100644 index 0000000000..17a4a99608 --- /dev/null +++ b/.github/workflows/update-glide-version/action.yml @@ -0,0 +1,26 @@ +name: Update GLIDE version in the config.toml file + +inputs: + folder_path: + description: "The folder path of the config.toml file" + required: true + type: string + named_os: + description: "The name of the current operating system" + required: false + default: "linux" + type: string + options: + - linux + - darwin +runs: + using: "composite" + steps: + - name: Update package version in config.toml + working-directory: ${{ inputs.folder_path }} + shell: bash + run: | + SED_FOR_MACOS=`if ${{ inputs.named_os == 'darwin' }}; then echo "''"; fi` + sed -i $SED_FOR_MACOS "s|unkown|${{ env.RELEASE_VERSION }}|g" ./config.toml + # log the config.toml file + cat ./config.toml diff --git a/benchmarks/rust/.cargo/config.toml b/benchmarks/rust/.cargo/config.toml index d7336d3306..2c96bf9a0e 100644 --- a/benchmarks/rust/.cargo/config.toml +++ b/benchmarks/rust/.cargo/config.toml @@ -1,3 +1,3 @@ [env] GLIDE_NAME = "Glide" # This should be overwritten by each wrapper library. -GLIDE_VERSION = "0.1.0" +GLIDE_VERSION = "unkown" diff --git a/csharp/lib/.cargo/config.toml b/csharp/lib/.cargo/config.toml index 45873d24a5..1a7a129ddf 100644 --- a/csharp/lib/.cargo/config.toml +++ b/csharp/lib/.cargo/config.toml @@ -1,3 +1,3 @@ [env] GLIDE_NAME = { value = "GlideC#", force = true } -GLIDE_VERSION = "0.1.0" +GLIDE_VERSION = "unkown" diff --git a/glide-core/.cargo/config.toml b/glide-core/.cargo/config.toml index d7336d3306..2c96bf9a0e 100644 --- a/glide-core/.cargo/config.toml +++ b/glide-core/.cargo/config.toml @@ -1,3 +1,3 @@ [env] GLIDE_NAME = "Glide" # This should be overwritten by each wrapper library. -GLIDE_VERSION = "0.1.0" +GLIDE_VERSION = "unkown" diff --git a/java/.cargo/config.toml b/java/.cargo/config.toml index 25c9e01f33..be27c1cdbc 100644 --- a/java/.cargo/config.toml +++ b/java/.cargo/config.toml @@ -1,3 +1,3 @@ [env] GLIDE_NAME = { value = "GlideJava", force = true } -GLIDE_VERSION = "0.1.0" +GLIDE_VERSION = "unkown" diff --git a/node/rust-client/.cargo/config.toml b/node/rust-client/.cargo/config.toml index 56be8c8010..2c2c619447 100644 --- a/node/rust-client/.cargo/config.toml +++ b/node/rust-client/.cargo/config.toml @@ -1,3 +1,3 @@ [env] GLIDE_NAME = { value = "GlideJS", force = true } -GLIDE_VERSION = "0.1.0" +GLIDE_VERSION = "unkown" diff --git a/python/.cargo/config.toml b/python/.cargo/config.toml index 3188c03f8a..264e270ffa 100644 --- a/python/.cargo/config.toml +++ b/python/.cargo/config.toml @@ -1,3 +1,3 @@ [env] GLIDE_NAME = { value = "GlidePy", force = true } -GLIDE_VERSION = "0.1.0" +GLIDE_VERSION = "unkown"