Skip to content

Commit 987c68a

Browse files
authored
feat: add release workflow (#5560)
* feat(ci): add draft release workflow * refactor: delete old release-github workflows * fixup! refactor: delete old release-github workflows * fixup! refactor: delete old release-github workflows * Update .github/workflows/release.yaml * fixup!: remove release-notes.txt * fixup!: change branch to current
1 parent 7ecfb95 commit 987c68a

File tree

6 files changed

+45
-151
lines changed

6 files changed

+45
-151
lines changed

.github/workflows/release.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Draft release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write # For creating releases.
8+
discussions: write # For creating a discussion.
9+
10+
# Cancel in-progress runs for pull requests when developers push
11+
# additional changes
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
16+
jobs:
17+
draft:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Download artifacts
25+
uses: dawidd6/action-download-artifact@v2
26+
id: download
27+
with:
28+
branch: ${{ github.ref }}
29+
workflow: ci.yaml
30+
workflow_conclusion: completed
31+
check_artifacts: true
32+
name: release-packages
33+
path: ./release-packages
34+
35+
- uses: softprops/action-gh-release@v1
36+
with:
37+
draft: true
38+
discussion_category_name: "📣 Announcements"
39+
files: ./release-packages/*

ci/build/release-github-assets.sh

-28
This file was deleted.

ci/build/release-github-draft.sh

-50
This file was deleted.

ci/lib.sh

-41
Original file line numberDiff line numberDiff line change
@@ -44,47 +44,6 @@ arch() {
4444
echo "$cpu"
4545
}
4646

47-
# Grabs the most recent ci.yaml github workflow run that was triggered from the
48-
# pull request of the release branch for this version (regardless of whether
49-
# that run succeeded or failed). The release branch name must be in semver
50-
# format with a v prepended.
51-
# This will contain the artifacts we want.
52-
# https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs
53-
get_artifacts_url() {
54-
local artifacts_url
55-
local version_branch="release/v$VERSION"
56-
local workflow_runs_url="repos/:owner/:repo/actions/workflows/ci.yaml/runs?event=pull_request&branch=$version_branch"
57-
artifacts_url=$(gh api "$workflow_runs_url" | jq -r ".workflow_runs[] | select(.head_branch == \"$version_branch\") | .artifacts_url" | head -n 1)
58-
if [[ -z "$artifacts_url" ]]; then
59-
echo >&2 "ERROR: artifacts_url came back empty"
60-
echo >&2 "We looked for a successful run triggered by a pull_request with for code-server version: $VERSION and a branch named $version_branch"
61-
echo >&2 "URL used for gh API call: $workflow_runs_url"
62-
exit 1
63-
fi
64-
65-
echo "$artifacts_url"
66-
}
67-
68-
# Grabs the artifact's download url.
69-
# https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts
70-
get_artifact_url() {
71-
local artifact_name="$1"
72-
gh api "$(get_artifacts_url)" | jq -r ".artifacts[] | select(.name == \"$artifact_name\") | .archive_download_url" | head -n 1
73-
}
74-
75-
# Uses the above two functions to download a artifact into a directory.
76-
download_artifact() {
77-
local artifact_name="$1"
78-
local dst="$2"
79-
80-
local tmp_file
81-
tmp_file="$(mktemp)"
82-
83-
gh api "$(get_artifact_url "$artifact_name")" > "$tmp_file"
84-
unzip -q -o "$tmp_file" -d "$dst"
85-
rm "$tmp_file"
86-
}
87-
8847
rsync() {
8948
command rsync -a --del "$@"
9049
}

docs/MAINTAINING.md

+6-30
Original file line numberDiff line numberDiff line change
@@ -137,43 +137,19 @@ changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
137137

138138
## Releases
139139

140-
With each release, we rotate the role of release manager to ensure every
141-
maintainer goes through the process. This helps us keep documentation up-to-date
142-
and encourages us to continually review and improve the flow.
143-
144-
If you're the current release manager, follow these steps:
145-
146-
1. Create a [release issue](../.github/ISSUE_TEMPLATE/release.md)
147-
1. Fill out checklist
148-
1. Publish the release
149-
1. After release is published, close release milestone
150-
151140
### Publishing a release
152141

153142
1. Create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
154143
1. If you don't do this, the `npm-brew` GitHub workflow will fail. It looks for the release artifacts under the branch pattern.
155-
1. Run `yarn release:prep` and type in the new version (e.g., `3.8.1`)
156-
1. GitHub Actions will generate the `npm-package`, `release-packages` and
157-
`release-images` artifacts. You do not have to wait for this step to complete
158-
before proceeding.
159-
1. Run `yarn release:github-draft` to create a GitHub draft release from the
160-
template with the updated version. Make sure to update the `CHANGELOG.md`.
144+
1. Run `yarn release:prep <version>` (e.g., `yarn release:prep 3.8.1`)
161145
1. Bump chart version in `Chart.yaml`.
162-
1. Summarize the major changes in the release notes and link to the relevant
163-
issues.
164-
1. Change the @ to target the version branch. Example: `v3.9.0 @ Target: release/v3.9.0`
165-
1. Wait for the `npm-package`, `release-packages` and `release-images` artifacts
166-
to build.
167-
1. Run `yarn release:github-assets` to download the `release-packages` artifact.
168-
They will upload them to the draft release.
169-
1. Run some basic sanity tests on one of the released packages (pay special
170-
attention to making sure the terminal works).
171-
1. Publish the release and merge the PR. CI will automatically grab the
146+
1. Summarize the major changes in the `CHANGELOG.md`
147+
1. Download CI artifacts and make sure code-server works locally.
148+
1. Merge PR and wait for CI build on `main` to finish.
149+
1. Go to GitHub Actions > Draft release > Run workflow off `main`. CI will automatically upload the artifacts to the release.
150+
1. Add the release notes from the `CHANGELOG.md` and publish release. CI will automatically grab the
172151
artifacts, publish the NPM package from `npm-package`, and publish the Docker
173152
Hub image from `release-images`.
174-
1. Update the AUR package. Instructions for updating the AUR package are at
175-
[coder/code-server-aur](https://github.com/coder/code-server-aur).
176-
1. Wait for the npm package to be published.
177153

178154
#### AUR
179155

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
"build:vscode": "./ci/build/build-vscode.sh",
1515
"release": "./ci/build/build-release.sh",
1616
"release:standalone": "./ci/build/build-standalone-release.sh",
17-
"release:github-draft": "./ci/build/release-github-draft.sh",
18-
"release:github-assets": "./ci/build/release-github-assets.sh",
1917
"release:prep": "./ci/build/release-prep.sh",
2018
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
2119
"test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh",

0 commit comments

Comments
 (0)