mirror of
https://github.com/coder/code-server.git
synced 2026-07-15 13:20:24 +02:00
Compare commits
4 Commits
1605d68709
...
53d981a724
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53d981a724 | ||
|
|
89ca02c1f7 | ||
|
|
2fafe8771d | ||
|
|
41c9ed499b |
39
.github/workflows/publish.yaml
vendored
39
.github/workflows/publish.yaml
vendored
@@ -70,6 +70,11 @@ jobs:
|
|||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
ref: "master"
|
ref: "master"
|
||||||
|
|
||||||
|
- name: Configure git
|
||||||
|
run: |
|
||||||
|
git config --global user.name cdrci
|
||||||
|
git config --global user.email opensource@coder.com
|
||||||
|
|
||||||
- name: Fetch and reset master
|
- name: Fetch and reset master
|
||||||
run: |
|
run: |
|
||||||
git remote add upstream https://github.com/coder/code-server-aur.git
|
git remote add upstream https://github.com/coder/code-server-aur.git
|
||||||
@@ -77,11 +82,6 @@ jobs:
|
|||||||
git reset --hard upstream/master
|
git reset --hard upstream/master
|
||||||
git push --force
|
git push --force
|
||||||
|
|
||||||
- name: Configure git
|
|
||||||
run: |
|
|
||||||
git config --global user.name cdrci
|
|
||||||
git config --global user.email opensource@coder.com
|
|
||||||
|
|
||||||
- name: Validate package
|
- name: Validate package
|
||||||
uses: heyhusen/archlinux-package-action@c9f94059ccbebe8710d31d582f33ef4e84fe575c # v3.0.0
|
uses: heyhusen/archlinux-package-action@c9f94059ccbebe8710d31d582f33ef4e84fe575c # v3.0.0
|
||||||
with:
|
with:
|
||||||
@@ -136,3 +136,32 @@ jobs:
|
|||||||
out-file-path: "release-packages"
|
out-file-path: "release-packages"
|
||||||
|
|
||||||
- run: npm run publish:docker
|
- run: npm run publish:docker
|
||||||
|
|
||||||
|
repo:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
|
TAG: ${{ inputs.version || github.ref_name }}
|
||||||
|
needs: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set version to tag without leading v
|
||||||
|
run: |
|
||||||
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
|
||||||
|
- run: ./ci/build/update-repo.sh
|
||||||
|
|
||||||
|
- name: Open PR
|
||||||
|
run: |
|
||||||
|
git config --global user.name cdrci
|
||||||
|
git config --global user.email opensource@coder.com
|
||||||
|
git checkout -b "helm/$VERSION"
|
||||||
|
git add .
|
||||||
|
git commit -m "Update to $VERSION"
|
||||||
|
git push -u origin "$(git branch --show)"
|
||||||
|
gh pr create \
|
||||||
|
--repo coder/code-server \
|
||||||
|
--body-file .cache/checklist \
|
||||||
|
--title "Update to $VERSION"
|
||||||
|
|||||||
29
.github/workflows/release.yaml
vendored
29
.github/workflows/release.yaml
vendored
@@ -6,6 +6,11 @@ on:
|
|||||||
version:
|
version:
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- closed
|
||||||
|
branches:
|
||||||
|
- "update/**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # For creating releases.
|
contents: write # For creating releases.
|
||||||
@@ -21,6 +26,7 @@ jobs:
|
|||||||
package-linux:
|
package-linux:
|
||||||
name: ${{ format('linux-{0}', matrix.vscode_arch) }}
|
name: ${{ format('linux-{0}', matrix.vscode_arch) }}
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -39,7 +45,7 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||||
TAG: ${{ inputs.version || github.ref_name }}
|
TAG: ${{ inputs.version || github.event.pull_request.head.ref || github.ref_name }}
|
||||||
# Set release package name.
|
# Set release package name.
|
||||||
ARCH: ${{ matrix.package_arch }}
|
ARCH: ${{ matrix.package_arch }}
|
||||||
# Cross-compile target.
|
# Cross-compile target.
|
||||||
@@ -64,9 +70,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
|
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
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Set version to tag without leading v
|
- name: Strip update/ and v from tag
|
||||||
run: |
|
run: |
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
version=${TAG#update/}
|
||||||
|
echo "VERSION=${version#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
with:
|
with:
|
||||||
@@ -99,12 +106,18 @@ jobs:
|
|||||||
if: ${{ matrix.vscode_arch == 'x64' }}
|
if: ${{ matrix.vscode_arch == 'x64' }}
|
||||||
- run: tar -czf package.tar.gz release
|
- run: tar -czf package.tar.gz release
|
||||||
if: ${{ matrix.vscode_arch == 'x64' }}
|
if: ${{ matrix.vscode_arch == 'x64' }}
|
||||||
|
- run: |
|
||||||
|
sed "/^## Unreleased/,/^## / ! d" CHANGELOG.md | head -n -2 | tail -n +3 > .cache/release-notes
|
||||||
|
if: ${{ matrix.vscode_arch == 'x64' }}
|
||||||
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
|
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
|
||||||
if: ${{ matrix.vscode_arch == 'x64' }}
|
if: ${{ matrix.vscode_arch == 'x64' }}
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
files: package.tar.gz
|
files: package.tar.gz
|
||||||
|
tag_name: v${{ env.VERSION }}
|
||||||
|
name: v${{ env.VERSION }}
|
||||||
|
body: .cache/release-notes
|
||||||
|
|
||||||
# Platform-specific release.
|
# Platform-specific release.
|
||||||
- run: KEEP_MODULES=1 npm run release
|
- run: KEEP_MODULES=1 npm run release
|
||||||
@@ -114,10 +127,13 @@ jobs:
|
|||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
files: ./release-packages/*
|
files: ./release-packages/*
|
||||||
|
tag_name: v${{ env.VERSION }}
|
||||||
|
name: v${{ env.VERSION }}
|
||||||
|
|
||||||
package-macos:
|
package-macos:
|
||||||
name: ${{ matrix.vscode_target }}
|
name: ${{ matrix.vscode_target }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
if: github.event_name == 'workflow_dispatch' || github.event.pull_request_merged == true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@@ -144,9 +160,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
|
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
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Set version to tag without leading v
|
- name: Strip update/ and v from tag
|
||||||
run: |
|
run: |
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
version=${TAG#update/}
|
||||||
|
echo "VERSION=${version#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
with:
|
with:
|
||||||
@@ -172,3 +189,5 @@ jobs:
|
|||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
files: ./release-packages/*
|
files: ./release-packages/*
|
||||||
|
tag_name: v${{ env.VERSION }}
|
||||||
|
name: v${{ env.VERSION }}
|
||||||
|
|||||||
46
ci/build/update-repo.sh
Executable file
46
ci/build/update-repo.sh
Executable file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
function update_helm() {
|
||||||
|
local current
|
||||||
|
current=$(yq .version ci/helm-chart/Chart.yaml)
|
||||||
|
local next
|
||||||
|
next=$(semver "$current" -i minor)
|
||||||
|
echo "Bumping version from $current to $next..."
|
||||||
|
sed -i.bak "s/^version: $current\$/version: $next/" ci/helm-chart/Chart.yaml
|
||||||
|
|
||||||
|
echo "Setting app version and image to $version..."
|
||||||
|
sed -i.bak "s/^appVersion: .\+\$/appVersion: $version/" ci/helm-chart/Chart.yaml
|
||||||
|
sed -i.bak "s/^ tag: .\+\$/ tag: '$version'/" ci/helm-chart/values.yaml
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_changelog() {
|
||||||
|
local date
|
||||||
|
date=$(printf '%(%Y-%m-%d)T\n' -1)
|
||||||
|
local link="https://github.com/coder/code-server/releases/tag/v$version"
|
||||||
|
sed -i.bak "s|## Unreleased|## Unreleased\n\n## [$version]($link) - $date|" CHANGELOG.md
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
cd "$(dirname "${0}")/../.."
|
||||||
|
|
||||||
|
source ./ci/lib.sh
|
||||||
|
|
||||||
|
local version=${VERSION:-$(git describe --tags)}
|
||||||
|
version="${version#v}"
|
||||||
|
|
||||||
|
declare -a steps
|
||||||
|
|
||||||
|
steps+=(
|
||||||
|
"Update Helm chart" "update_helm"
|
||||||
|
"Update changelog" "update_changelog"
|
||||||
|
)
|
||||||
|
|
||||||
|
run-steps "${steps[@]}"
|
||||||
|
|
||||||
|
# This step is always manual.
|
||||||
|
echo "- [ ] https://github.com/coder/code-server-aur/pulls" >> .cache/checklist
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
@@ -2,17 +2,6 @@
|
|||||||
|
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
function quiet() {
|
|
||||||
"$@" >/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
function indent() {
|
|
||||||
local count=2
|
|
||||||
local space
|
|
||||||
space=$(printf "%${count}s")
|
|
||||||
sed "s/^/$space| /g"
|
|
||||||
}
|
|
||||||
|
|
||||||
function unapply_patches() {
|
function unapply_patches() {
|
||||||
local -i exit_code=0
|
local -i exit_code=0
|
||||||
quiet quilt pop -af || exit_code=$?
|
quiet quilt pop -af || exit_code=$?
|
||||||
@@ -110,31 +99,6 @@ function update_csp() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function run() {
|
|
||||||
local -i failed=0
|
|
||||||
rm -f .cache/checklist
|
|
||||||
while (( $# )) ; do
|
|
||||||
local name=$1 ; shift
|
|
||||||
local fn=$1 ; shift
|
|
||||||
# Only run if an earlier step has not failed.
|
|
||||||
if [[ $failed == 0 ]] ; then
|
|
||||||
echo "$name..."
|
|
||||||
if $fn | indent ; then
|
|
||||||
echo "- [X] $name" >> .cache/checklist
|
|
||||||
else
|
|
||||||
((failed++))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
# For all failed steps, write out an empty checkbox.
|
|
||||||
if [[ $failed != 0 ]] ; then
|
|
||||||
echo "- [ ] $name" >> .cache/checklist
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [[ $failed != 0 ]] ; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function add_changelog() {
|
function add_changelog() {
|
||||||
local file=CHANGELOG.md
|
local file=CHANGELOG.md
|
||||||
if grep --quiet "Code $target_vscode_version" "$file" ; then
|
if grep --quiet "Code $target_vscode_version" "$file" ; then
|
||||||
@@ -181,7 +145,7 @@ function main() {
|
|||||||
"Add changelog note" "add_changelog"
|
"Add changelog note" "add_changelog"
|
||||||
)
|
)
|
||||||
|
|
||||||
run "${steps[@]}"
|
run-steps "${steps[@]}"
|
||||||
|
|
||||||
# This step is always manual.
|
# This step is always manual.
|
||||||
echo "- [ ] Verify changelog" >> .cache/checklist
|
echo "- [ ] Verify changelog" >> .cache/checklist
|
||||||
|
|||||||
36
ci/lib.sh
36
ci/lib.sh
@@ -78,6 +78,42 @@ nodeArch() {
|
|||||||
echo "$cpu"
|
echo "$cpu"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run-steps() {
|
||||||
|
local -i failed=0
|
||||||
|
rm -f .cache/checklist
|
||||||
|
while (( $# )) ; do
|
||||||
|
local name=$1 ; shift
|
||||||
|
local fn=$1 ; shift
|
||||||
|
# Only run if an earlier step has not failed.
|
||||||
|
if [[ $failed == 0 ]] ; then
|
||||||
|
echo "$name..."
|
||||||
|
if $fn | indent ; then
|
||||||
|
echo "- [X] $name" >> .cache/checklist
|
||||||
|
else
|
||||||
|
((failed++))
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# For all failed steps, write out an empty checkbox.
|
||||||
|
if [[ $failed != 0 ]] ; then
|
||||||
|
echo "- [ ] $name" >> .cache/checklist
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ $failed != 0 ]] ; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
quiet() {
|
||||||
|
"$@" >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
indent() {
|
||||||
|
local count=2
|
||||||
|
local space
|
||||||
|
space=$(printf "%${count}s")
|
||||||
|
sed "s/^/$space| /g"
|
||||||
|
}
|
||||||
|
|
||||||
# See gulpfile.reh.ts for available targets.
|
# See gulpfile.reh.ts for available targets.
|
||||||
if [[ ! ${VSCODE_TARGET-} ]]; then
|
if [[ ! ${VSCODE_TARGET-} ]]; then
|
||||||
VSCODE_TARGET="$(nodeOS)-$(nodeArch)"
|
VSCODE_TARGET="$(nodeOS)-$(nodeArch)"
|
||||||
|
|||||||
Reference in New Issue
Block a user