From 00b8de36e9940bfe3841e7a0fd0b536486ff7449 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 15 Mar 2022 14:05:06 -0700 Subject: [PATCH 01/11] fix(ci): correctly download npm artifact From 11346d68bd75bc6d0de14453b4af78ce5073a40e Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 16 Mar 2022 14:28:31 -0700 Subject: [PATCH 02/11] fixup! fix(ci): correctly download npm artifact --- .github/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9b7450d23b4f..5b3f0e6f29e4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -197,9 +197,12 @@ jobs: with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - name: Download artifact + uses: dawidd6/action-download-artifact@v2 id: download with: + branch: release + workflow_conclusion: completed name: "npm-package" path: release-npm-package From 418e6a94b059eb3eb3edef58be58780345d8389b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 16 Mar 2022 14:31:02 -0700 Subject: [PATCH 03/11] docs: update MAINTAINING --- docs/MAINTAINING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md index 7e0c0c24812a..72c68a6cff2b 100644 --- a/docs/MAINTAINING.md +++ b/docs/MAINTAINING.md @@ -164,7 +164,7 @@ If you're the current release manager, follow these steps: ### Publishing a release -1. Create a release branch called `v0.0.0` but replace with new version +1. Create a new branch called `release` (the npm workflow will look for this when a new GitHub release is published) 1. Run `yarn release:prep` and type in the new version (e.g., `3.8.1`) 1. GitHub Actions will generate the `npm-package`, `release-packages` and `release-images` artifacts. You do not have to wait for this step to complete From a21015c609bf7ba274617b656473ea6e3c6407a3 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 16 Mar 2022 14:47:20 -0700 Subject: [PATCH 04/11] fixup! docs: update MAINTAINING --- .github/workflows/ci.yaml | 4 +--- .github/workflows/npm-brew.yaml | 7 +++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b3f0e6f29e4..7e566b807970 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -198,11 +198,9 @@ jobs: fetch-depth: 0 - name: Download artifact - uses: dawidd6/action-download-artifact@v2 + - uses: actions/download-artifact@v3 id: download with: - branch: release - workflow_conclusion: completed name: "npm-package" path: release-npm-package diff --git a/.github/workflows/npm-brew.yaml b/.github/workflows/npm-brew.yaml index 8c8b84fe2c38..04cad9352e56 100644 --- a/.github/workflows/npm-brew.yaml +++ b/.github/workflows/npm-brew.yaml @@ -23,12 +23,15 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - name: Download artifact + uses: dawidd6/action-download-artifact@v2 id: download with: + branch: release + workflow_conclusion: completed name: "npm-package" path: release-npm-package - + - name: Publish npm package and tag with "latest" run: yarn publish:npm env: From 0768b26f42bcb605dffed1b8987e29eb8ded29f0 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 16 Mar 2022 14:49:39 -0700 Subject: [PATCH 05/11] fixup! Merge branch 'main' into 4949-chore-fix-npm-workflow --- .github/workflows/npm-brew.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-brew.yaml b/.github/workflows/npm-brew.yaml index 04cad9352e56..a3d511f39a38 100644 --- a/.github/workflows/npm-brew.yaml +++ b/.github/workflows/npm-brew.yaml @@ -31,7 +31,7 @@ jobs: workflow_conclusion: completed name: "npm-package" path: release-npm-package - + - name: Publish npm package and tag with "latest" run: yarn publish:npm env: From d63b336b7ab0bb0b9644f1c51023010517ea3b94 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 17 Mar 2022 10:08:24 -0700 Subject: [PATCH 06/11] chore: get ci to run From b69b6a11ee906d1e8dddff75d7f927fea3b78e13 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 17 Mar 2022 10:38:21 -0700 Subject: [PATCH 07/11] refactor: use vVERSION branch name instead of release --- .github/workflows/npm-brew.yaml | 6 +++++- docs/MAINTAINING.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-brew.yaml b/.github/workflows/npm-brew.yaml index a3d511f39a38..77e65cda598b 100644 --- a/.github/workflows/npm-brew.yaml +++ b/.github/workflows/npm-brew.yaml @@ -23,11 +23,15 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Get version branch + id: version-branch + run: echo "::set-output name=name::v$(jq .version package.json)" + - name: Download artifact uses: dawidd6/action-download-artifact@v2 id: download with: - branch: release + branch: v${{ steps.version-branch.outputs.name }} workflow_conclusion: completed name: "npm-package" path: release-npm-package diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md index 72c68a6cff2b..07699ec25a2d 100644 --- a/docs/MAINTAINING.md +++ b/docs/MAINTAINING.md @@ -164,7 +164,7 @@ If you're the current release manager, follow these steps: ### Publishing a release -1. Create a new branch called `release` (the npm workflow will look for this when a new GitHub release is published) +1. Create a new branch called `v0.0.0` (replace 0s with actual version aka v4.1.0) 1. Run `yarn release:prep` and type in the new version (e.g., `3.8.1`) 1. GitHub Actions will generate the `npm-package`, `release-packages` and `release-images` artifacts. You do not have to wait for this step to complete From b83a2bb110f3ac5a22e4b472537ca86dcd3ec63c Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 17 Mar 2022 10:41:40 -0700 Subject: [PATCH 08/11] refactor: use new download artifact in docker workflow --- .github/workflows/docker.yaml | 13 +++++++++++++ ci/steps/docker-buildx-push.sh | 9 +++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 7cc0c1e27e11..64f2ac6ff60d 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -35,6 +35,19 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Get version branch + id: version-branch + run: echo "::set-output name=name::v$(jq .version package.json)" + + - name: Download artifact + uses: dawidd6/action-download-artifact@v2 + id: download + with: + branch: v${{ steps.version-branch.outputs.name }} + workflow_conclusion: completed + name: "release-packages" + path: release-packages + - name: Run ./ci/steps/docker-buildx-push.sh run: ./ci/steps/docker-buildx-push.sh env: diff --git a/ci/steps/docker-buildx-push.sh b/ci/steps/docker-buildx-push.sh index c3bb0579635a..ba09cd76a115 100755 --- a/ci/steps/docker-buildx-push.sh +++ b/ci/steps/docker-buildx-push.sh @@ -4,12 +4,9 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." - # ci/lib.sh sets VERSION and provides download_artifact here - source ./ci/lib.sh - - # Download the release-packages artifact - download_artifact release-packages ./release-packages - + # NOTE@jsjoeio - this script assumes that you've downloaded + # the release-packages artifact to ./release-packages before + # running this docker buildx step docker buildx bake -f ci/release-image/docker-bake.hcl --push } From 88de49ff19fbec22916ddf9507c37dc15af20e7d Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 17 Mar 2022 10:45:26 -0700 Subject: [PATCH 09/11] refactor: clean up release-github-assets script --- ci/build/release-github-assets.sh | 9 +++++++++ ci/steps/publish-npm.sh | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ci/build/release-github-assets.sh b/ci/build/release-github-assets.sh index 29f27566816a..6395adcb7eec 100755 --- a/ci/build/release-github-assets.sh +++ b/ci/build/release-github-assets.sh @@ -9,6 +9,15 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." source ./ci/lib.sh + source ./ci/steps/steps-lib.sh + + # NOTE@jsjoeio - only needed if we use the download_artifact + # because we talk to the GitHub API. + # Needed to use GitHub API + if ! is_env_var_set "GITHUB_TOKEN"; then + echo "GITHUB_TOKEN is not set. Cannot download npm release-packages without GitHub credentials." + exit 1 + fi download_artifact release-packages ./release-packages local assets=(./release-packages/code-server*"$VERSION"*{.tar.gz,.deb,.rpm}) diff --git a/ci/steps/publish-npm.sh b/ci/steps/publish-npm.sh index b2d87e51e04c..36ca0773b3f5 100755 --- a/ci/steps/publish-npm.sh +++ b/ci/steps/publish-npm.sh @@ -13,14 +13,6 @@ main() { exit 1 fi - # NOTE@jsjoeio - only needed if we use the download_artifact - # because we talk to the GitHub API. - # Needed to use GitHub API - if ! is_env_var_set "GITHUB_TOKEN"; then - echo "GITHUB_TOKEN is not set. Cannot download npm release artifact without GitHub credentials." - exit 1 - fi - ## Publishing Information # All the variables below are used to determine how we should publish # the npm package. We also use this information for bumping the version. From 9d9a356976c3b9aaf9e5e29fc84c7b93a5f0d171 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 17 Mar 2022 10:54:20 -0700 Subject: [PATCH 10/11] fixup: remove extra v --- .github/workflows/docker.yaml | 8 ++++---- .github/workflows/npm-brew.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 64f2ac6ff60d..d622e2c73fae 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -35,15 +35,15 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get version branch - id: version-branch - run: echo "::set-output name=name::v$(jq .version package.json)" + - name: Get version + id: version + run: echo "::set-output name=version::$(jq .version package.json)" - name: Download artifact uses: dawidd6/action-download-artifact@v2 id: download with: - branch: v${{ steps.version-branch.outputs.name }} + branch: v${{ steps.version.outputs.version }} workflow_conclusion: completed name: "release-packages" path: release-packages diff --git a/.github/workflows/npm-brew.yaml b/.github/workflows/npm-brew.yaml index 77e65cda598b..785f427c4a83 100644 --- a/.github/workflows/npm-brew.yaml +++ b/.github/workflows/npm-brew.yaml @@ -23,15 +23,15 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Get version branch - id: version-branch - run: echo "::set-output name=name::v$(jq .version package.json)" + - name: Get version + id: version + run: echo "::set-output name=version::$(jq .version package.json)" - name: Download artifact uses: dawidd6/action-download-artifact@v2 id: download with: - branch: v${{ steps.version-branch.outputs.name }} + branch: v${{ steps.version.outputs.version }} workflow_conclusion: completed name: "npm-package" path: release-npm-package From b27ad22f1e4cf39f580eb04950c388a2431b6c70 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 17 Mar 2022 11:00:19 -0700 Subject: [PATCH 11/11] fixup! fixup: remove extra v --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7e566b807970..32e2ead383d3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -198,7 +198,7 @@ jobs: fetch-depth: 0 - name: Download artifact - - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v3 id: download with: name: "npm-package"