From cad9a41e6d7ade61441e3d48b5bf8f26cf9e0468 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 08:51:19 -0700 Subject: [PATCH 01/28] refactor: get version dynamically --- .github/workflows/publish.yaml | 11 +++-- .github/workflows/release.yaml | 84 ++++++++++++++++++++++------------ 2 files changed, 62 insertions(+), 33 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index a5bf2d11c77f..5fe4edc58b26 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,6 +4,11 @@ on: # Shows the manual trigger in GitHub UI # helpful as a back-up in case the GitHub Actions Workflow fails workflow_dispatch: + inputs: + version: + description: The version to publish (include "v", i.e. "v4.9.1"). + type: string + required: true release: types: [released] @@ -24,15 +29,11 @@ jobs: - name: Checkout code-server uses: actions/checkout@v3 - - name: Get version - id: version - run: echo "::set-output name=version::$(jq -r .version package.json)" - - name: Download npm package from release artifacts uses: robinraju/release-downloader@v1.5 with: repository: "coder/code-server" - tag: v${{ steps.version.outputs.version }} + tag: ${{ github.event.inputs.version || github.ref_name }} fileName: "package.tar.gz" out-file-path: "release-npm-package" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2d61cc07dc2b..9e029439ea71 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,11 @@ name: Draft release on: workflow_dispatch: + inputs: + version: + description: The version to publish (don't include the "v"). + type: string + required: true permissions: contents: write # For creating releases. @@ -21,6 +26,7 @@ jobs: name: x86-64 Linux build runs-on: ubuntu-latest timeout-minutes: 15 + needs: npm-version container: "centos:7" env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -51,15 +57,10 @@ jobs: - name: Install yarn run: npm install -g yarn - - name: Download artifacts - uses: dawidd6/action-download-artifact@v2 - id: download + - name: Download npm package + uses: actions/download-artifact@v3 with: - branch: ${{ github.ref }} - workflow: build.yaml - workflow_conclusion: completed - check_artifacts: true - name: npm-package + name: npm-release-package - name: Decompress npm package run: tar -xzf package.tar.gz @@ -123,6 +124,7 @@ jobs: name: Linux cross-compile builds runs-on: ubuntu-18.04 timeout-minutes: 15 + needs: npm-version strategy: matrix: include: @@ -159,15 +161,10 @@ jobs: env: PACKAGE: ${{ format('g++-{0}', matrix.prefix) }} - - name: Download artifacts - uses: dawidd6/action-download-artifact@v2 - id: download + - name: Download npm package + uses: actions/download-artifact@v3 with: - branch: ${{ github.ref }} - workflow: build.yaml - workflow_conclusion: completed - check_artifacts: true - name: npm-package + name: npm-release-package - name: Decompress npm package run: tar -xzf package.tar.gz @@ -194,6 +191,7 @@ jobs: name: x86-64 macOS build runs-on: macos-latest timeout-minutes: 15 + needs: npm-version steps: - name: Checkout repo uses: actions/checkout@v3 @@ -209,15 +207,10 @@ jobs: curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Download artifacts - uses: dawidd6/action-download-artifact@v2 - id: download + - name: Download npm package + uses: actions/download-artifact@v3 with: - branch: ${{ github.ref }} - workflow: build.yaml - workflow_conclusion: completed - check_artifacts: true - name: npm-package + name: npm-release-package - name: Decompress npm package run: tar -xzf package.tar.gz @@ -254,6 +247,23 @@ jobs: name: Upload npm package runs-on: ubuntu-latest timeout-minutes: 15 + needs: npm-version + steps: + - name: Download npm package + uses: actions/download-artifact@v3 + with: + name: npm-release-package + + - uses: softprops/action-gh-release@v1 + with: + draft: true + discussion_category_name: "📣 Announcements" + files: ./package.tar.gz + + npm-version: + name: Modify package.json version + runs-on: ubuntu-latest + timeout-minutes: 15 steps: - name: Download artifacts uses: dawidd6/action-download-artifact@v2 @@ -265,8 +275,26 @@ jobs: check_artifacts: true name: npm-package - - uses: softprops/action-gh-release@v1 + - name: Decompress npm package + run: tar -xzf package.tar.gz + + - name: Modify version + run: | + echo "Updating version in root package.json" + npm version --prefix release ${{ github.event.inputs.version || github.ref_name }} + + echo "Updating version in lib/vscode/product.json" + tmp=$(mktemp) + jq '.codeServerVersion = ${{ github.event.inputs.version || github.ref_name }}' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json + + # TODO@jsjoeio - will it throw error if it already exists? + - name: Compress release package + run: tar -czf package.tar.gz release + + - name: Upload npm package artifact + uses: actions/upload-artifact@v3 with: - draft: true - discussion_category_name: "📣 Announcements" - files: ./package.tar.gz + name: npm-release-package + path: ./package.tar.gz + + # upload here or separate job From 42d40296703354a7457d903884c008c1f82a277b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 08:52:37 -0700 Subject: [PATCH 02/28] chore: remove version --- .github/workflows/build.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a08ab52a3e64..ab2d33de3a05 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -187,10 +187,6 @@ jobs: id: vscode-rev run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)" - - name: Get version - id: version - run: echo "::set-output name=version::$(jq -r .version package.json)" - # We need to rebuild when we have a new version of Code, when any of # the patches changed, or when the code-server version changes (since # it gets embedded into the code). Use VSCODE_CACHE_VERSION to @@ -200,7 +196,7 @@ jobs: uses: actions/cache@v3 with: path: lib/vscode-reh-web-* - key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ steps.version.outputs.version }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }} + key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }} - name: Build vscode if: steps.cache-vscode.outputs.cache-hit != 'true' From 0b31a4395cbab3e77fb603539e35e364c3467188 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 09:23:36 -0700 Subject: [PATCH 03/28] fixup: missing quotes --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9e029439ea71..0a48a16cb040 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -285,7 +285,7 @@ jobs: echo "Updating version in lib/vscode/product.json" tmp=$(mktemp) - jq '.codeServerVersion = ${{ github.event.inputs.version || github.ref_name }}' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json + jq '.codeServerVersion = "${{ github.event.inputs.version || github.ref_name }}"' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json # TODO@jsjoeio - will it throw error if it already exists? - name: Compress release package From 25e5f63fa5dd5dadf56c48c000a08d9b0822bdef Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 11:30:19 -0700 Subject: [PATCH 04/28] refactor: drop global VERSION --- ci/lib.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ci/lib.sh b/ci/lib.sh index 789ccb001059..2b5023fd1c6b 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -9,10 +9,6 @@ popd() { builtin popd > /dev/null } -pkg_json_version() { - jq -r .version package.json -} - vscode_version() { jq -r .version lib/vscode/package.json } @@ -48,8 +44,6 @@ rsync() { command rsync -a --del "$@" } -VERSION="$(pkg_json_version)" -export VERSION ARCH="$(arch)" export ARCH OS=$(os) From 784ad5686c905ac0fb550b422bc4098b29af8e89 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 11:30:37 -0700 Subject: [PATCH 05/28] wip: updating ersion in publish --- .github/workflows/publish.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5fe4edc58b26..72c792f0c514 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -63,9 +63,17 @@ jobs: git config --global user.name cdrci git config --global user.email opensource@coder.com + - name: Get and set VERSION + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION="${TAG#v}" + echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + - name: Bump code-server homebrew version env: + VERSION: ${{ steps.version.outputs.version }} HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}} + run: ./ci/steps/brew-bump.sh aur: @@ -74,6 +82,8 @@ jobs: timeout-minutes: 10 env: GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} + VERSION: ${{ github.event.inputs.version || github.ref_name }} + steps: # We need to checkout code-server so we can get the version - name: Checkout code-server From ea99731d3c4c5bf94727bb6b2284a1507a5a7afb Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 12:56:55 -0700 Subject: [PATCH 06/28] refactor: update publish.yaml with version changes --- .github/workflows/publish.yaml | 31 ++++++++++++++++++++++--------- ci/steps/docker-buildx-push.sh | 5 ++--- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 72c792f0c514..9796a8df1986 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -37,9 +37,17 @@ jobs: fileName: "package.tar.gz" out-file-path: "release-npm-package" + - name: Get and set VERSION + id: version + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION="${TAG#v}" + echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + - name: Publish npm package and tag with "latest" run: yarn publish:npm env: + VERSION: ${{ steps.version.outputs.version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_ENVIRONMENT: "production" @@ -64,6 +72,7 @@ jobs: git config --global user.email opensource@coder.com - name: Get and set VERSION + id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" VERSION="${TAG#v}" @@ -92,13 +101,6 @@ jobs: fetch-depth: 0 path: "./code-server" - - name: Get code-server version - id: version - run: | - pushd code-server - echo "::set-output name=version::$(jq -r .version package.json)" - popd - - name: Checkout code-server-aur repo uses: actions/checkout@v3 with: @@ -117,6 +119,13 @@ jobs: git config --global user.name cdrci git config --global user.email opensource@coder.com + - name: Get and set VERSION + id: version + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION="${TAG#v}" + echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + - name: Validate package uses: hapakaien/archlinux-package-action@v2 with: @@ -158,9 +167,12 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Get version + - name: Get and set VERSION id: version - run: echo "::set-output name=version::$(jq -r .version package.json)" + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION="${TAG#v}" + echo "{version}={$VERSION}" >> $GITHUB_OUTPUT - name: Download release artifacts uses: robinraju/release-downloader@v1.5 @@ -173,4 +185,5 @@ jobs: - name: Publish to Docker run: yarn publish:docker env: + VERSION: ${{ steps.version.outputs.version }} GITHUB_TOKEN: ${{ github.token }} diff --git a/ci/steps/docker-buildx-push.sh b/ci/steps/docker-buildx-push.sh index ebe86047c0bd..6314063ffa54 100755 --- a/ci/steps/docker-buildx-push.sh +++ b/ci/steps/docker-buildx-push.sh @@ -3,9 +3,8 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." - # ci/lib.sh sets VERSION so it's available to ci/release-image/docker-bake.hcl - # to push the VERSION tag. - source ./ci/lib.sh + # NOTE@jsjoeio - this script assumes VERSION exists as an + # environment variable. # NOTE@jsjoeio - this script assumes that you've downloaded # the release-packages artifact to ./release-packages before From 81d4f7fcd84b167b9de653f8f9ef9883bdc6da23 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 13:02:05 -0700 Subject: [PATCH 07/28] refactor: release.yaml with new version changes --- .github/workflows/release.yaml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0a48a16cb040..84d106bbfc7e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: The version to publish (don't include the "v"). + description: The version to publish (include "v", i.e. "v4.9.1"). type: string required: true @@ -92,7 +92,16 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} if: success() + - name: Get and set VERSION + id: version + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION="${TAG#v}" + echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + - name: Build packages with nfpm + env: + VERSION: ${{ steps.version.outputs.version }} run: yarn package - uses: softprops/action-gh-release@v1 @@ -178,7 +187,16 @@ jobs: tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2 mv ./node ./release-standalone/lib/node + - name: Get and set VERSION + id: version + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION="${TAG#v}" + echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + - name: Build packages with nfpm + env: + VERSION: ${{ steps.version.outputs.version }} run: yarn package ${NPM_CONFIG_ARCH} - uses: softprops/action-gh-release@v1 @@ -234,7 +252,16 @@ jobs: - name: Run native module tests on standalone release run: yarn test:native + - name: Get and set VERSION + id: version + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION="${TAG#v}" + echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + - name: Build packages with nfpm + env: + VERSION: ${{ steps.version.outputs.version }} run: yarn package - uses: softprops/action-gh-release@v1 @@ -296,5 +323,3 @@ jobs: with: name: npm-release-package path: ./package.tar.gz - - # upload here or separate job From e09a263ac22f3324fd2c35b66177d8261401da23 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 13:25:24 -0700 Subject: [PATCH 08/28] refactor: update build.yaml with version changes --- .github/workflows/build.yaml | 6 ++++++ ci/build/build-vscode.sh | 1 + ci/steps/publish-npm.sh | 7 +------ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ab2d33de3a05..2129d220ffea 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -257,6 +257,12 @@ jobs: - name: Run ./ci/steps/publish-npm.sh run: yarn publish:npm env: + # NOTE@jsjoeio + # This is because npm enforces semantic versioning + # so it has to be a valid version. We only use this + # to publish dev versions from prs + # and beta versions from main. + VERSION: "0.0.0" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # NOTE@jsjoeio diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index 631964d5e7e4..f7bcf3010322 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -47,6 +47,7 @@ main() { # as it is a submodule. export VSCODE_DISTRO_COMMIT VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD) + VERSION=$(jq -r .version package.json) # Add the date, our name, links, and enable telemetry (this just makes # telemetry available; telemetry can still be disabled by flag or setting). diff --git a/ci/steps/publish-npm.sh b/ci/steps/publish-npm.sh index cdbdb1361dc6..468dc98bae18 100755 --- a/ci/steps/publish-npm.sh +++ b/ci/steps/publish-npm.sh @@ -19,12 +19,6 @@ main() { # This is because npm won't publish your package unless it's a new version. # i.e. for development, we bump the version to -- # example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040" - # We need the current package.json VERSION - if ! is_env_var_set "VERSION"; then - echo "VERSION is not set. Cannot publish to npm without VERSION." - exit 1 - fi - # We use this to grab the PR_NUMBER if ! is_env_var_set "GITHUB_REF"; then echo "GITHUB_REF is not set. Are you running this locally? We rely on values provided by GitHub." @@ -102,6 +96,7 @@ main() { # This means the npm version will be tagged with "beta" # and installed when a user runs `yarn install code-server@beta` NPM_TAG="beta" + PACKAGE_NAME="@coder/code-server-pr" fi if [[ "$NPM_ENVIRONMENT" == "development" ]]; then From 599587e3202f81e13b910b4441e23a960cb4a95d Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 13:28:45 -0700 Subject: [PATCH 09/28] chore: update maintainer --- ci/build/nfpm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/nfpm.yaml b/ci/build/nfpm.yaml index ae9d69c35328..db5cbcf5f509 100644 --- a/ci/build/nfpm.yaml +++ b/ci/build/nfpm.yaml @@ -4,7 +4,7 @@ platform: "linux" version: "v${VERSION}" section: "devel" priority: "optional" -maintainer: "Anmol Sethi " +maintainer: "Joe Previte " description: | Run VS Code in the browser. vendor: "Coder" From 06b89aaf1a2ad042ebb7a5b4e5fe9efb389228a7 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 14:26:00 -0700 Subject: [PATCH 10/28] fixup: update version in build-vscode --- ci/build/build-vscode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index f7bcf3010322..19e933ca4f94 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -47,7 +47,7 @@ main() { # as it is a submodule. export VSCODE_DISTRO_COMMIT VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD) - VERSION=$(jq -r .version package.json) + VERSION=$(jq -r .version ../../package.json) # Add the date, our name, links, and enable telemetry (this just makes # telemetry available; telemetry can still be disabled by flag or setting). From 9749c6841d5b14c816185378c87305e1894c8d07 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 14:44:23 -0700 Subject: [PATCH 11/28] fixup: fix github env version --- .github/workflows/release.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 84d106bbfc7e..7635d7357d8e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -96,12 +96,10 @@ jobs: id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION="${TAG#v}" - echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + VERSION_FROM_TAG="${TAG#v}" + echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT - name: Build packages with nfpm - env: - VERSION: ${{ steps.version.outputs.version }} run: yarn package - uses: softprops/action-gh-release@v1 @@ -191,8 +189,8 @@ jobs: id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION="${TAG#v}" - echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + VERSION_FROM_TAG="${TAG#v}" + echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT - name: Build packages with nfpm env: @@ -256,8 +254,8 @@ jobs: id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION="${TAG#v}" - echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + VERSION_FROM_TAG="${TAG#v}" + echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT - name: Build packages with nfpm env: From 4264a23d5fe51be8a1dc0b281452d5aad83a6896 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 14:55:24 -0700 Subject: [PATCH 12/28] try macos only --- .github/workflows/release.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7635d7357d8e..d9eae168490d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -258,8 +258,6 @@ jobs: echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT - name: Build packages with nfpm - env: - VERSION: ${{ steps.version.outputs.version }} run: yarn package - uses: softprops/action-gh-release@v1 From 056acae7d0ea85fe38c171b583eb7cd3b2f03b1e Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 15:05:06 -0700 Subject: [PATCH 13/28] try again --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d9eae168490d..391041c0edaa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -258,6 +258,8 @@ jobs: echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT - name: Build packages with nfpm + env: + VERSION: ${{ env.VERSION }} run: yarn package - uses: softprops/action-gh-release@v1 From 0ae3d033f0002ff7d438be9873232f66b59726e2 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 15:25:37 -0700 Subject: [PATCH 14/28] last resort --- .github/workflows/release.yaml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 391041c0edaa..e97506f5bf9f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -321,3 +321,51 @@ jobs: with: name: npm-release-package path: ./package.tar.gz + + asher: + name: testing asher's method + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: first + env: + VERSION: "${${{ github.events.inputs.version || github.ref_name }}#v}" + run: echo "$VERSION is the version" + + asher2: + name: testing asher's second method + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: second + env: + VERSION: ${{ github.events.inputs.version || github.ref_name }} + run: | + echo "$VERSION is the version" + VERSION=${VERSION#v} echo "$VERSION strippeddddd" + + asher3: + name: testing asher's third method + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Download artifacts + env: + VERSION: ${{ github.events.inputs.version || github.ref_name }} + run: VERSION=${VERSION#v} yarn publish + + joe: + name: testing joe's first method + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Download artifacts + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + VERSION_FROM_TAG="${TAG#v}" + echo "VERSION=$VERSION_FROM_TAG" >> $GITHUB_OUTPUT + + - name: Build packages with nfpm + env: + VERSION: ${{ env.VERSION }} + run: echo "$VERSION hello there" From 9a34495b3792dbbec5920e4e623205b4bcd1fb3a Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 15:30:08 -0700 Subject: [PATCH 15/28] joe again --- .github/workflows/release.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e97506f5bf9f..2201a167ff4d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -362,8 +362,7 @@ jobs: - name: Download artifacts run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION_FROM_TAG="${TAG#v}" - echo "VERSION=$VERSION_FROM_TAG" >> $GITHUB_OUTPUT + echo "VERSION="${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm env: From 6dcc1753353b491e4acbeba7a6d336b8b60ceba0 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 15:31:22 -0700 Subject: [PATCH 16/28] this oneee --- .github/workflows/release.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2201a167ff4d..6c1017ef80c4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -354,6 +354,21 @@ jobs: VERSION: ${{ github.events.inputs.version || github.ref_name }} run: VERSION=${VERSION#v} yarn publish + asher4: + name: testing asher's fourth method + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Download artifacts + run: | + TAG="${{ github.event.inputs.version || github.ref_name }}" + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + + - name: Build packages with nfpm + env: + VERSION: ${{ env.VERSION }} + run: echo "$VERSION hello there" + joe: name: testing joe's first method runs-on: ubuntu-latest @@ -362,7 +377,7 @@ jobs: - name: Download artifacts run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - echo "VERSION="${TAG#v}" >> $GITHUB_ENV + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm env: From 413c0059b0b91449f5079c61b12238e2f33dcf31 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 15:40:15 -0700 Subject: [PATCH 17/28] fixup: this should work --- .github/workflows/publish.yaml | 24 ++++------- .github/workflows/release.yaml | 78 +++------------------------------- 2 files changed, 14 insertions(+), 88 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9796a8df1986..28ef57eb930d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -38,16 +38,14 @@ jobs: out-file-path: "release-npm-package" - name: Get and set VERSION - id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION="${TAG#v}" - echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Publish npm package and tag with "latest" run: yarn publish:npm env: - VERSION: ${{ steps.version.outputs.version }} + VERSION: ${{ env.VERSION }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_ENVIRONMENT: "production" @@ -72,15 +70,13 @@ jobs: git config --global user.email opensource@coder.com - name: Get and set VERSION - id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION="${TAG#v}" - echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Bump code-server homebrew version env: - VERSION: ${{ steps.version.outputs.version }} + VERSION: ${{ env.VERSION }} HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}} run: ./ci/steps/brew-bump.sh @@ -120,16 +116,14 @@ jobs: git config --global user.email opensource@coder.com - name: Get and set VERSION - id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION="${TAG#v}" - echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Validate package uses: hapakaien/archlinux-package-action@v2 with: - pkgver: ${{ steps.version.outputs.version }} + pkgver: ${{ env.VERSION }} updpkgsums: true srcinfo: true @@ -168,17 +162,15 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Get and set VERSION - id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION="${TAG#v}" - echo "{version}={$VERSION}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Download release artifacts uses: robinraju/release-downloader@v1.5 with: repository: "coder/code-server" - tag: v${{ steps.version.outputs.version }} + tag: v${{ env.VERSION }} fileName: "*.deb" out-file-path: "release-packages" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6c1017ef80c4..538d00519985 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -93,13 +93,13 @@ jobs: if: success() - name: Get and set VERSION - id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION_FROM_TAG="${TAG#v}" - echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm + env: + VERSION: ${{ env.VERSION }} run: yarn package - uses: softprops/action-gh-release@v1 @@ -186,15 +186,13 @@ jobs: mv ./node ./release-standalone/lib/node - name: Get and set VERSION - id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION_FROM_TAG="${TAG#v}" - echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm env: - VERSION: ${{ steps.version.outputs.version }} + VERSION: ${{ env.VERSION }} run: yarn package ${NPM_CONFIG_ARCH} - uses: softprops/action-gh-release@v1 @@ -251,11 +249,9 @@ jobs: run: yarn test:native - name: Get and set VERSION - id: version run: | TAG="${{ github.event.inputs.version || github.ref_name }}" - VERSION_FROM_TAG="${TAG#v}" - echo "{VERSION}={$VERSION_FROM_TAG}" >> $GITHUB_OUTPUT + echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm env: @@ -321,65 +317,3 @@ jobs: with: name: npm-release-package path: ./package.tar.gz - - asher: - name: testing asher's method - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: first - env: - VERSION: "${${{ github.events.inputs.version || github.ref_name }}#v}" - run: echo "$VERSION is the version" - - asher2: - name: testing asher's second method - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: second - env: - VERSION: ${{ github.events.inputs.version || github.ref_name }} - run: | - echo "$VERSION is the version" - VERSION=${VERSION#v} echo "$VERSION strippeddddd" - - asher3: - name: testing asher's third method - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Download artifacts - env: - VERSION: ${{ github.events.inputs.version || github.ref_name }} - run: VERSION=${VERSION#v} yarn publish - - asher4: - name: testing asher's fourth method - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Download artifacts - run: | - TAG="${{ github.event.inputs.version || github.ref_name }}" - echo "VERSION=${TAG#v}" >> $GITHUB_ENV - - - name: Build packages with nfpm - env: - VERSION: ${{ env.VERSION }} - run: echo "$VERSION hello there" - - joe: - name: testing joe's first method - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - name: Download artifacts - run: | - TAG="${{ github.event.inputs.version || github.ref_name }}" - echo "VERSION=${TAG#v}" >> $GITHUB_ENV - - - name: Build packages with nfpm - env: - VERSION: ${{ env.VERSION }} - run: echo "$VERSION hello there" From 83c08014788d9d10e343021d3bb41bbd763cd09f Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 15:44:21 -0700 Subject: [PATCH 18/28] try using inputs --- .github/workflows/release.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 538d00519985..29a58284c447 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -94,7 +94,7 @@ jobs: - name: Get and set VERSION run: | - TAG="${{ github.event.inputs.version || github.ref_name }}" + TAG="${{ inputs.version || github.ref_name }}" echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm @@ -187,7 +187,7 @@ jobs: - name: Get and set VERSION run: | - TAG="${{ github.event.inputs.version || github.ref_name }}" + TAG="${{ inputs.version || github.ref_name }}" echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm @@ -250,7 +250,7 @@ jobs: - name: Get and set VERSION run: | - TAG="${{ github.event.inputs.version || github.ref_name }}" + TAG="${{ inputs.version || github.ref_name }}" echo "VERSION=${TAG#v}" >> $GITHUB_ENV - name: Build packages with nfpm @@ -302,11 +302,11 @@ jobs: - name: Modify version run: | echo "Updating version in root package.json" - npm version --prefix release ${{ github.event.inputs.version || github.ref_name }} + npm version --prefix release ${{ inputs.version || github.ref_name }} echo "Updating version in lib/vscode/product.json" tmp=$(mktemp) - jq '.codeServerVersion = "${{ github.event.inputs.version || github.ref_name }}"' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json + jq '.codeServerVersion = "${{ inputs.version || github.ref_name }}"' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json # TODO@jsjoeio - will it throw error if it already exists? - name: Compress release package From 5e4642e860ec4d6aa13bb83a59e025531bef5238 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 4 Nov 2022 16:10:22 -0700 Subject: [PATCH 19/28] docs: update release notes --- docs/MAINTAINING.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md index 6ce83d4932a5..31c5c925032f 100644 --- a/docs/MAINTAINING.md +++ b/docs/MAINTAINING.md @@ -142,16 +142,16 @@ changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS). ### Publishing a release -1. Create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0) -1. Run `yarn release:prep` -1. Bump chart version in `Chart.yaml`. -1. Summarize the major changes in the `CHANGELOG.md` -1. Download CI artifacts and make sure code-server works locally. -1. Merge PR and wait for CI build on `main` to finish. -1. Go to GitHub Actions > Draft release > Run workflow off `main`. CI will automatically upload the artifacts to the release. -1. Add the release notes from the `CHANGELOG.md` and publish release. CI will automatically grab the +1. Go to GitHub Actions > Draft release > Run workflow off commit you want to + release. CI will automatically upload the artifacts to the release. Make sure CI + has finished on that commit. +1. CI will automatically grab the artifacts, publish the NPM package from `npm-package`, and publish the Docker Hub image from `release-images`. +1. Publish release. +1. After, create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0) +1. Summarize the major changes in the `CHANGELOG.md` +1. Bump chart version in `Chart.yaml`. #### Release Candidates From 3efac1880c8f7319390885ee5564ce2f3c900096 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Nov 2022 11:40:05 -0700 Subject: [PATCH 20/28] fixup!: use env.VERSION in docker step --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 28ef57eb930d..dbf49e85087e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -177,5 +177,5 @@ jobs: - name: Publish to Docker run: yarn publish:docker env: - VERSION: ${{ steps.version.outputs.version }} + VERSION: ${{ env.VERSION }} GITHUB_TOKEN: ${{ github.token }} From 9cd480bfe9bffa4fbd0138db9b16c0c0f451835d Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Nov 2022 11:43:00 -0700 Subject: [PATCH 21/28] fixup!: comment get and set version --- .github/workflows/publish.yaml | 8 ++++++++ .github/workflows/release.yaml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index dbf49e85087e..66267f0b4693 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -37,6 +37,8 @@ jobs: fileName: "package.tar.gz" out-file-path: "release-npm-package" + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 - name: Get and set VERSION run: | TAG="${{ github.event.inputs.version || github.ref_name }}" @@ -69,6 +71,8 @@ jobs: git config --global user.name cdrci git config --global user.email opensource@coder.com + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 - name: Get and set VERSION run: | TAG="${{ github.event.inputs.version || github.ref_name }}" @@ -115,6 +119,8 @@ jobs: git config --global user.name cdrci git config --global user.email opensource@coder.com + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 - name: Get and set VERSION run: | TAG="${{ github.event.inputs.version || github.ref_name }}" @@ -161,6 +167,8 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 - name: Get and set VERSION run: | TAG="${{ github.event.inputs.version || github.ref_name }}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 29a58284c447..3af0f530b197 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -92,6 +92,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} if: success() + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 - name: Get and set VERSION run: | TAG="${{ inputs.version || github.ref_name }}" @@ -185,6 +187,8 @@ jobs: tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2 mv ./node ./release-standalone/lib/node + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 - name: Get and set VERSION run: | TAG="${{ inputs.version || github.ref_name }}" @@ -248,6 +252,8 @@ jobs: - name: Run native module tests on standalone release run: yarn test:native + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 - name: Get and set VERSION run: | TAG="${{ inputs.version || github.ref_name }}" From e503fa45cebaffa5895a19042935d1162dc2064f Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Nov 2022 11:43:23 -0700 Subject: [PATCH 22/28] fixup!: remove compress release package comment --- .github/workflows/release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3af0f530b197..5117054946b6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -314,7 +314,6 @@ jobs: tmp=$(mktemp) jq '.codeServerVersion = "${{ inputs.version || github.ref_name }}"' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json - # TODO@jsjoeio - will it throw error if it already exists? - name: Compress release package run: tar -czf package.tar.gz release From c08c0b765299f833b55899d03648a57e0d7cb7ff Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Nov 2022 11:49:30 -0700 Subject: [PATCH 23/28] fixup!: use $VERSION in npm-version --- .github/workflows/release.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5117054946b6..906bf2234142 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -305,14 +305,23 @@ jobs: - name: Decompress npm package run: tar -xzf package.tar.gz + # NOTE@jsjoeio - we do this so we can strip out the v + # i.e. v4.9.1 -> 4.9.1 + - name: Get and set VERSION + run: | + TAG="${{ inputs.version || github.ref_name }}" + echo "VERSION=${TAG#v}" >> $GITHUB_ENV + - name: Modify version + env: + VERSION: ${{ env.VERSION )}} run: | echo "Updating version in root package.json" - npm version --prefix release ${{ inputs.version || github.ref_name }} + npm version --prefix release "$VERSION" echo "Updating version in lib/vscode/product.json" tmp=$(mktemp) - jq '.codeServerVersion = "${{ inputs.version || github.ref_name }}"' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json + jq '.codeServerVersion = "$VERSION"' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json - name: Compress release package run: tar -czf package.tar.gz release From 7aa1784fdc790529947a05901b495607806a432c Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Nov 2022 12:39:57 -0700 Subject: [PATCH 24/28] refactor: set VERSION in build VS Code step --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2129d220ffea..df8b634ef9ec 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -199,6 +199,8 @@ jobs: key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }} - name: Build vscode + env: + VERSION: "0.0.0" if: steps.cache-vscode.outputs.cache-hit != 'true' run: yarn build:vscode From d9ff1806fcaf6637814ddbcd28fc41b8a085446f Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Nov 2022 12:40:24 -0700 Subject: [PATCH 25/28] refactor: use 0.0.0 in package.json version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb0939573d64..df72dfc7fda0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-server", "license": "MIT", - "version": "4.8.2", + "version": "0.0.0", "description": "Run VS Code on a remote server.", "homepage": "https://github.com/coder/code-server", "bugs": { From aabbe5ed5f8ac772c49ac73f718e8d073601c0ed Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 7 Nov 2022 12:40:41 -0700 Subject: [PATCH 26/28] refactor: delete release-prep script --- ci/build/release-prep.sh | 103 --------------------------------------- 1 file changed, 103 deletions(-) delete mode 100755 ci/build/release-prep.sh diff --git a/ci/build/release-prep.sh b/ci/build/release-prep.sh deleted file mode 100755 index 0960414ca539..000000000000 --- a/ci/build/release-prep.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env bash -# Description: This is a script to make the release process easier -# Run it with `yarn release:prep` and it will do the following: -# 1. Check that you have gh installed and that you're signed in -# 2. Update the version of code-server (package.json, docs, etc.) -# 3. Update the code coverage badge in the README -# 4. Open a draft PR using the release_template.md and view in browser -# If you want to perform a dry run of this script run DRY_RUN=1 yarn release:prep - -set -euo pipefail - -CHECKMARK="\xE2\x9C\x94" -DASH="-" - -main() { - if [ "${DRY_RUN-}" = 1 ]; then - echo "Performing a dry run..." - CMD="echo" - else - CMD='' - fi - - cd "$(dirname "$0")/../.." - - # Check that gh is installed - if ! command -v gh &> /dev/null; then - echo "gh could not be found." - echo "We use this with the release-github-draft.sh and release-github-assets.sh scripts." - echo -e "See docs here: https://github.com/cli/cli#installation" - exit - fi - - # Check that they have jq installed - if ! command -v jq &> /dev/null; then - echo "jq could not be found." - echo "We use this to parse the package.json and grab the current version of code-server." - echo -e "See docs here: https://stedolan.github.io/jq/download/" - exit - fi - - # Check that they have rg installed - if ! command -v rg &> /dev/null; then - echo "rg could not be found." - echo "We use this when updating files across the codebase." - echo -e "See docs here: https://github.com/BurntSushi/ripgrep#installation" - exit - fi - - # Check that they have node installed - if ! command -v node &> /dev/null; then - echo "node could not be found." - echo "That's surprising..." - echo "We use it in this script for getting the package.json version" - echo -e "See docs here: https://nodejs.org/en/download/" - exit - fi - - # Check that gh is authenticated - if ! gh auth status -h github.com &> /dev/null; then - echo "gh isn't authenticated to github.com." - echo "This is needed for our scripts that use gh." - echo -e "See docs regarding authentication: https://cli.github.com/manual/gh_auth_login" - exit - fi - - # Note: we need to set upstream as well or the gh pr create step will fail - # See: https://github.com/cli/cli/issues/575 - CURRENT_BRANCH=$(git branch | grep '\*' | cut -d' ' -f2-) - if [[ -z $(git config "branch.${CURRENT_BRANCH}.remote") ]]; then - echo "Doesn't look like you've pushed this branch to remote" - # Note: we need to set upstream as well or the gh pr create step will fail - # See: https://github.com/cli/cli/issues/575 - echo "Please set the upstream and then run the script" - exit 1 - fi - - # credit to jakwuh for this solution - # https://gist.github.com/DarrenN/8c6a5b969481725a4413#gistcomment-1971123 - CODE_SERVER_CURRENT_VERSION=$(node -pe "require('./package.json').version") - # Ask which version we should update to - # In the future, we'll automate this and determine the latest version automatically - echo -e "$DASH Current version: ${CODE_SERVER_CURRENT_VERSION}" - # The $'\n' adds a line break. See: https://stackoverflow.com/a/39581815/3015595 - CODE_SERVER_VERSION_TO_UPDATE=$(git rev-parse --abbrev-ref HEAD | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/') - echo -e "$CHECKMARK Version in branch name" - echo -e "$CHECKMARK Updating to: $CODE_SERVER_VERSION_TO_UPDATE" - - $CMD rg -g '!yarn.lock' -g '!*.svg' -g '!CHANGELOG.md' -g '!lib/vscode/**' --files-with-matches --fixed-strings "${CODE_SERVER_CURRENT_VERSION}" | $CMD xargs sd "$CODE_SERVER_CURRENT_VERSION" "$CODE_SERVER_VERSION_TO_UPDATE" - - $CMD git commit --no-verify -am "chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE" - - # This runs from the root so that's why we use this path vs. ../../ - RELEASE_TEMPLATE_STRING=$(cat ./.github/PULL_REQUEST_TEMPLATE/release_template.md) - - echo -e "\nOpening a draft PR on GitHub" - # To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create - $CMD gh pr create --base main --title "release: $CODE_SERVER_VERSION_TO_UPDATE" --body "$RELEASE_TEMPLATE_STRING" --reviewer @coder/code-server --repo coder/code-server --draft --assignee "@me" - - # Open PR in browser - $CMD gh pr view --web -} - -main "$@" From 17f16b771b58a346ebbeb2faa0baf2395e095fda Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 8 Nov 2022 13:38:37 -0700 Subject: [PATCH 27/28] Update ci/build/build-vscode.sh --- ci/build/build-vscode.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index 19e933ca4f94..631964d5e7e4 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -47,7 +47,6 @@ main() { # as it is a submodule. export VSCODE_DISTRO_COMMIT VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD) - VERSION=$(jq -r .version ../../package.json) # Add the date, our name, links, and enable telemetry (this just makes # telemetry available; telemetry can still be disabled by flag or setting). From 2b7761180973d0c93c93116f0604b52a8d9020ba Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 8 Nov 2022 15:28:36 -0700 Subject: [PATCH 28/28] fixup!: remove extra VERSION set in aur --- .github/workflows/publish.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 66267f0b4693..de50fd07f1f6 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -91,7 +91,6 @@ jobs: timeout-minutes: 10 env: GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} - VERSION: ${{ github.event.inputs.version || github.ref_name }} steps: # We need to checkout code-server so we can get the version