diff --git a/.github/workflows/sapling-cli-homebrew-macos-arm64-release.yml b/.github/workflows/sapling-cli-homebrew-macos-arm64-release.yml index 9b7e2d071d497..555dcb39a590f 100644 --- a/.github/workflows/sapling-cli-homebrew-macos-arm64-release.yml +++ b/.github/workflows/sapling-cli-homebrew-macos-arm64-release.yml @@ -15,7 +15,7 @@ jobs: run: git config --global --add safe.directory "$PWD" - name: set-env SAPLING_VERSION shell: bash - run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: Prepare build environment run: 'eden/scm/packaging/mac/prepare_environment.py \ @@ -33,7 +33,7 @@ jobs: - name: Create Sapling bottle run: brew bottle sapling - name: Rename bottle to some platform specific name - run: mv sapling*monterey.bottle.tar.gz sapling_0.0-${{ env.SAPLING_VERSION }}.arm64_monterey.bottle.tar.gz + run: mv sapling*monterey.bottle.tar.gz sapling_${{ env.SAPLING_VERSION }}.arm64_monterey.bottle.tar.gz - name: Upload Artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/sapling-cli-homebrew-macos-x86-release.yml b/.github/workflows/sapling-cli-homebrew-macos-x86-release.yml index 23db08ccd7dbd..485c638e2b4ca 100644 --- a/.github/workflows/sapling-cli-homebrew-macos-x86-release.yml +++ b/.github/workflows/sapling-cli-homebrew-macos-x86-release.yml @@ -15,7 +15,7 @@ jobs: run: git config --global --add safe.directory "$PWD" - name: set-env SAPLING_VERSION shell: bash - run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: Prepare build environment run: 'eden/scm/packaging/mac/prepare_environment.py \ @@ -33,7 +33,7 @@ jobs: - name: Create Sapling bottle run: brew bottle sapling - name: Rename bottle to some platform specific name - run: mv sapling*monterey.bottle.tar.gz sapling_0.0-${{ env.SAPLING_VERSION }}.monterey.bottle.tar.gz + run: mv sapling*monterey.bottle.tar.gz sapling_${{ env.SAPLING_VERSION }}.monterey.bottle.tar.gz - name: Upload Artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/sapling-cli-ubuntu-20.04-ci.yml b/.github/workflows/sapling-cli-ubuntu-20.04-ci.yml index d28e0f04166e6..a1694383e4f5d 100644 --- a/.github/workflows/sapling-cli-ubuntu-20.04-ci.yml +++ b/.github/workflows/sapling-cli-ubuntu-20.04-ci.yml @@ -14,13 +14,13 @@ jobs: run: rustup default stable - name: set-env DEB_UPSTREAM_VERSION shell: bash - run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: set-env SAPLING_VERSION shell: bash - run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: Create .deb working-directory: ./eden/scm - run: ${{ format('VERSION=0.0-{0} make deb', env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('VERSION={0} make deb', env.DEB_UPSTREAM_VERSION) }} - name: Rename .deb working-directory: ./eden/scm - run: ${{ format('mv sapling_0.0-{0}_amd64.deb sapling_0.0-{0}_amd64.Ubuntu20.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('mv sapling_{0}_amd64.deb sapling_{0}_amd64.Ubuntu20.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} diff --git a/.github/workflows/sapling-cli-ubuntu-20.04-release.yml b/.github/workflows/sapling-cli-ubuntu-20.04-release.yml index d979e1eacd736..47c29ace41196 100644 --- a/.github/workflows/sapling-cli-ubuntu-20.04-release.yml +++ b/.github/workflows/sapling-cli-ubuntu-20.04-release.yml @@ -19,16 +19,16 @@ jobs: run: rustup default stable - name: set-env DEB_UPSTREAM_VERSION shell: bash - run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: set-env SAPLING_VERSION shell: bash - run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: Create .deb working-directory: ./eden/scm - run: ${{ format('VERSION=0.0-{0} make deb', env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('VERSION={0} make deb', env.DEB_UPSTREAM_VERSION) }} - name: Rename .deb working-directory: ./eden/scm - run: ${{ format('mv sapling_0.0-{0}_amd64.deb sapling_0.0-{0}_amd64.Ubuntu20.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('mv sapling_{0}_amd64.deb sapling_{0}_amd64.Ubuntu20.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} - name: Upload Artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/sapling-cli-ubuntu-22.04-ci.yml b/.github/workflows/sapling-cli-ubuntu-22.04-ci.yml index e0d25f9900ae1..e348f94286603 100644 --- a/.github/workflows/sapling-cli-ubuntu-22.04-ci.yml +++ b/.github/workflows/sapling-cli-ubuntu-22.04-ci.yml @@ -14,13 +14,13 @@ jobs: run: rustup default stable - name: set-env DEB_UPSTREAM_VERSION shell: bash - run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: set-env SAPLING_VERSION shell: bash - run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: Create .deb working-directory: ./eden/scm - run: ${{ format('VERSION=0.0-{0} make deb', env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('VERSION={0} make deb', env.DEB_UPSTREAM_VERSION) }} - name: Rename .deb working-directory: ./eden/scm - run: ${{ format('mv sapling_0.0-{0}_amd64.deb sapling_0.0-{0}_amd64.Ubuntu22.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('mv sapling_{0}_amd64.deb sapling_{0}_amd64.Ubuntu22.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} diff --git a/.github/workflows/sapling-cli-ubuntu-22.04-release.yml b/.github/workflows/sapling-cli-ubuntu-22.04-release.yml index 4024a0746728d..c87596ae56282 100644 --- a/.github/workflows/sapling-cli-ubuntu-22.04-release.yml +++ b/.github/workflows/sapling-cli-ubuntu-22.04-release.yml @@ -19,16 +19,16 @@ jobs: run: rustup default stable - name: set-env DEB_UPSTREAM_VERSION shell: bash - run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "DEB_UPSTREAM_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: set-env SAPLING_VERSION shell: bash - run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: Create .deb working-directory: ./eden/scm - run: ${{ format('VERSION=0.0-{0} make deb', env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('VERSION={0} make deb', env.DEB_UPSTREAM_VERSION) }} - name: Rename .deb working-directory: ./eden/scm - run: ${{ format('mv sapling_0.0-{0}_amd64.deb sapling_0.0-{0}_amd64.Ubuntu22.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} + run: ${{ format('mv sapling_{0}_amd64.deb sapling_{0}_amd64.Ubuntu22.04.deb', env.DEB_UPSTREAM_VERSION, env.DEB_UPSTREAM_VERSION) }} - name: Upload Artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/sapling-cli-windows-amd64-release.yml b/.github/workflows/sapling-cli-windows-amd64-release.yml index 9222cc7cd311e..4934203f8e0da 100644 --- a/.github/workflows/sapling-cli-windows-amd64-release.yml +++ b/.github/workflows/sapling-cli-windows-amd64-release.yml @@ -21,7 +21,7 @@ jobs: run: vcpkg integrate install - name: set-env SAPLING_VERSION shell: bash - run: echo "SAPLING_VERSION=$(ci/tag-name.sh | tr \- .)" >> $GITHUB_ENV + run: echo "SAPLING_VERSION=$(ci/tag-name.sh)" >> $GITHUB_ENV - name: build and zip run: python3 ./eden/scm/packaging/windows/build_windows_zip.py - name: rename .zip diff --git a/SAPLING_VERSION b/SAPLING_VERSION new file mode 100644 index 0000000000000..49d59571fbf6e --- /dev/null +++ b/SAPLING_VERSION @@ -0,0 +1 @@ +0.1 diff --git a/ci/gen_workflows.py b/ci/gen_workflows.py index c2e66ba46d909..c37db4d09f5d1 100755 --- a/ci/gen_workflows.py +++ b/ci/gen_workflows.py @@ -271,19 +271,17 @@ def gen_build_ubuntu_cli_job(self, *, ubuntu_version: str, deb_version_expr: str "name": "rustup", "run": "rustup default stable", }, - create_set_env_step( - DEB_UPSTREAM_VERSION, "$(ci/tag-name.sh | tr \\- .)" - ), - create_set_env_step(SAPLING_VERSION, "$(ci/tag-name.sh | tr \\- .)"), + create_set_env_step(DEB_UPSTREAM_VERSION, "$(ci/tag-name.sh)"), + create_set_env_step(SAPLING_VERSION, "$(ci/tag-name.sh)"), { "name": "Create .deb", "working-directory": "./eden/scm", - "run": f"${{{{ format('VERSION=0.0-{{0}} make deb', env.{DEB_UPSTREAM_VERSION}) }}}}", + "run": f"${{{{ format('VERSION={{0}} make deb', env.{DEB_UPSTREAM_VERSION}) }}}}", }, { "name": "Rename .deb", "working-directory": "./eden/scm", - "run": f"${{{{ format('mv sapling_0.0-{{0}}_amd64.deb sapling_0.0-{{0}}_amd64.Ubuntu{ubuntu_version}.deb', env.{DEB_UPSTREAM_VERSION}, env.{DEB_UPSTREAM_VERSION}) }}}}", + "run": f"${{{{ format('mv sapling_{{0}}_amd64.deb sapling_{{0}}_amd64.Ubuntu{ubuntu_version}.deb', env.{DEB_UPSTREAM_VERSION}, env.{DEB_UPSTREAM_VERSION}) }}}}", }, ], } @@ -312,7 +310,7 @@ def gen_windows_release(self) -> str: }, # This makes vcpkg packages available globally. {"name": "integrate vcpkg", "run": "vcpkg integrate install"}, - create_set_env_step(SAPLING_VERSION, "$(ci/tag-name.sh | tr \\- .)"), + create_set_env_step(SAPLING_VERSION, "$(ci/tag-name.sh)"), { "name": "build and zip", "run": "python3 ./eden/scm/packaging/windows/build_windows_zip.py", @@ -357,7 +355,7 @@ def gen_homebrew_macos_release( "steps": [ {"name": "Checkout Code", "uses": "actions/checkout@v3"}, grant_repo_access(), - create_set_env_step(SAPLING_VERSION, "$(ci/tag-name.sh | tr \\- .)"), + create_set_env_step(SAPLING_VERSION, "$(ci/tag-name.sh)"), { "name": "Prepare build environment", "run": "eden/scm/packaging/mac/prepare_environment.py \\\n" @@ -377,7 +375,7 @@ def gen_homebrew_macos_release( }, { "name": "Rename bottle to some platform specific name", - "run": "mv %s sapling_0.0-${{ env.SAPLING_VERSION }}.%s" + "run": "mv %s sapling_${{ env.SAPLING_VERSION }}.%s" % (artifact_glob, final_ext), }, upload_artifact(artifact_key, artifact_glob), diff --git a/ci/tag-name.sh b/ci/tag-name.sh index 30f7ea4e612e0..bf0bba9669e46 100755 --- a/ci/tag-name.sh +++ b/ci/tag-name.sh @@ -4,4 +4,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -git -c "core.abbrev=8" show -s "--format=%cd-%h" "--date=format:%Y%m%d-%H%M%S" +DIR=$(dirname -- "$0") +VERSION=$(cat "$DIR"/../SAPLING_VERSION) +COMMIT_INFO=$(git -c "core.abbrev=8" show -s "--format=%cd-%h" "--date=format:%Y%m%d-%H%M%S") +echo "$VERSION"."$COMMIT_INFO"