Answers two things: how to install these without a marketplace, and how to keep settings in sync when VS Code's Settings Sync cannot be pointed at Gitea. - build.ps1 packages each extension into dist/ - publish.ps1 creates a release and uploads them, replacing same-named assets so a rolling "latest" tag stays clean - install.ps1 downloads a release's assets and installs them, or -Local from dist/ - settings.ps1 copies User/ between the repo and the machine, and installs the marketplace extensions recorded in extensions.txt - dev-link.ps1 junctions the sources into ~/.vscode/extensions for development - ci-release.sh plus a Gitea Actions workflow do the build and publish on a tag push Settings are copied, not symlinked: an atomic save replaces a symlink with a regular file and the sync stops without looking broken. vsce/ pins vsce and undici so packaging works on Node 18, which current vsce does not support. test/run.ps1 drives the real scripts against a stub of the Gitea release API. It caught the multipart Content-Disposition being unquoted on .NET Framework, and Invoke-WebRequest dropping the Authorization header across a redirect.
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
# Packages the extensions and publishes them to a Gitea release.
|
|
#
|
|
# Needs a registered act_runner on the instance, and a GITEA_TOKEN secret with
|
|
# write:repository plus read access to the extension repos. Gitea fetches the
|
|
# actions/* actions from github.com unless the instance overrides
|
|
# [actions] DEFAULT_ACTIONS_URL, so a locked-down instance may need those mirrored.
|
|
#
|
|
# ci-release.sh needs only bash, git, node and curl -- everything the runner image
|
|
# already has once setup-node has run.
|
|
#
|
|
# The runner uses Node 20, which is also why CI is the easy way to build these:
|
|
# vsce does not run on Node 18. See the README.
|
|
|
|
name: Release extensions
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Release tag to publish to'
|
|
required: false
|
|
default: 'latest'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Package and publish
|
|
env:
|
|
GITEA_SERVER: ${{ github.server_url }}
|
|
GITEA_OWNER: ${{ github.repository_owner }}
|
|
GITEA_REPO: ${{ github.event.repository.name }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
# A tag push publishes to that tag; a manual run to whatever was asked for.
|
|
TAG: ${{ github.ref_type == 'tag' && github.ref_name || inputs.tag }}
|
|
run: bash scripts/ci-release.sh
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: vsix
|
|
path: dist/*.vsix
|