mirror of
https://github.com/coder/code-server.git
synced 2026-05-08 21:37:27 +02:00
I figure it is probably faster to keep it up to date than to merge larger and larger changes each time?
139 lines
4.5 KiB
YAML
139 lines
4.5 KiB
YAML
name: Publish code-server
|
|
|
|
on:
|
|
# Shows the manual trigger in GitHub UI
|
|
# helpful as a back-up in case the GitHub Actions Workflow fails
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
type: string
|
|
required: true
|
|
|
|
release:
|
|
types: [released]
|
|
|
|
# Cancel in-progress runs for pull requests when developers push
|
|
# additional changes, and serialize builds in branches.
|
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
npm:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TAG: ${{ inputs.version || github.ref_name }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
NPM_ENVIRONMENT: "production"
|
|
|
|
steps:
|
|
- name: Set version to tag without leading v
|
|
run: |
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: .node-version
|
|
|
|
- uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
|
|
with:
|
|
repository: "coder/code-server"
|
|
tag: ${{ env.TAG }}
|
|
fileName: "package.tar.gz"
|
|
out-file-path: "release-npm-package"
|
|
|
|
- run: tar -xzf release-npm-package/package.tar.gz
|
|
- run: |
|
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
pushd release
|
|
npm publish --tag latest --access public
|
|
|
|
aur:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
env:
|
|
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
|
TAG: ${{ inputs.version || github.ref_name }}
|
|
|
|
steps:
|
|
- name: Set version to tag without leading v
|
|
run: |
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
|
|
- name: Checkout code-server-aur repo
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: "cdrci/code-server-aur"
|
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
|
ref: "master"
|
|
|
|
- name: Fetch and reset master
|
|
run: |
|
|
git remote add upstream https://github.com/coder/code-server-aur.git
|
|
git fetch upstream
|
|
git reset --hard upstream/master
|
|
git push --force
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config --global user.name cdrci
|
|
git config --global user.email opensource@coder.com
|
|
|
|
- name: Validate package
|
|
uses: heyhusen/archlinux-package-action@c9f94059ccbebe8710d31d582f33ef4e84fe575c # v3.0.0
|
|
with:
|
|
pkgver: ${{ env.VERSION }}
|
|
updpkgsums: true
|
|
srcinfo: true
|
|
|
|
- name: Open PR
|
|
run: |
|
|
git checkout -b update-version-${{ env.VERSION }}
|
|
git add .
|
|
git commit -m "chore: updating version to ${{ env.VERSION }}"
|
|
git push -u origin $(git branch --show)
|
|
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
TAG: ${{ inputs.version || github.ref_name }}
|
|
|
|
steps:
|
|
- name: Set version to tag without leading v
|
|
run: |
|
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
|
|
- uses: actions/checkout@v6
|
|
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
|
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
|
|
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
|
|
with:
|
|
repository: "coder/code-server"
|
|
tag: v${{ env.VERSION }}
|
|
fileName: "*.deb"
|
|
out-file-path: "release-packages"
|
|
- uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
|
|
with:
|
|
repository: "coder/code-server"
|
|
tag: v${{ env.VERSION }}
|
|
fileName: "*.rpm"
|
|
out-file-path: "release-packages"
|
|
|
|
- run: npm run publish:docker
|