Merge pull request #174 from docker/buildx-dap-documentation #346
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- v* | |
paths-ignore: | |
- '**/*.md' | |
jobs: | |
test-latest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: actions/checkout@v4 (docker/docker-language-server) | |
uses: actions/checkout@v4 | |
with: | |
repository: docker/docker-language-server | |
path: docker-language-server | |
- name: actions/checkout@v4 (docker/vscode-extension) | |
uses: actions/checkout@v4 | |
with: | |
repository: docker/vscode-extension | |
path: vscode-extension | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.23.8" | |
- run: npm install | |
working-directory: vscode-extension | |
- run: rm -rf vscode-extension/bin | |
- run: mkdir vscode-extension/bin | |
- run: make build | |
working-directory: docker-language-server | |
- run: mv docker-language-server/docker-language-server-linux-amd64 vscode-extension/bin | |
- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
- run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test | |
working-directory: vscode-extension | |
test-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" | |
- run: npm install | |
- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
- run: xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' npm test | |
build: | |
runs-on: ubuntu-latest | |
needs: | |
- test-latest | |
- test-release | |
strategy: | |
matrix: | |
os: [alpine, linux, win32, darwin] | |
arch: [amd64, arm64] | |
include: | |
- arch: amd64 | |
nodearch: x64 | |
- arch: arm64 | |
nodearch: arm64 | |
- os: win32 | |
nodeos: win32 | |
ext: .exe | |
- os: darwin | |
nodeos: darwin | |
ext: "" | |
- os: linux | |
nodeos: linux | |
ext: "" | |
- os: alpine | |
nodeos: linux | |
ext: "" | |
steps: | |
- name: actions/checkout@v4 (docker/vscode-extension) | |
uses: actions/checkout@v4 | |
with: | |
path: vscode-extension | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" | |
- working-directory: vscode-extension | |
run: | | |
NODE_OS=${{ matrix.nodeos }} NODE_ARCH=${{ matrix.nodearch }} npm install | |
- name: Set variables | |
id: set-variables | |
working-directory: vscode-extension | |
run: | | |
VERSION=$(npm pkg get version | tr -d \") | |
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" | |
SHA=$(git rev-parse --short HEAD) | |
echo "SHA=$SHA" >> "$GITHUB_OUTPUT" | |
- name: Build the extension (refs/heads) | |
if: startsWith(github.ref, 'refs/heads') | |
env: | |
VERSION: ${{ steps.set-variables.outputs.VERSION }} | |
SHA: ${{ steps.set-variables.outputs.SHA }} | |
working-directory: vscode-extension | |
run: | | |
npm install -g @vscode/vsce | |
vsce package --target ${{ matrix.os }}-${{ matrix.nodearch }} -o docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-$VERSION-$SHA.vsix | |
- name: actions/upload-artifact@v4 (refs/heads) | |
if: startsWith(github.ref, 'refs/heads') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}-${{ steps.set-variables.outputs.SHA }}.vsix | |
path: vscode-extension/docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}-${{ steps.set-variables.outputs.SHA }}.vsix | |
if-no-files-found: error | |
- name: Build the extension (refs/tags/v) | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
VERSION: ${{ steps.set-variables.outputs.VERSION }} | |
working-directory: vscode-extension | |
run: | | |
npm install -g @vscode/vsce | |
vsce package --target ${{ matrix.os }}-${{ matrix.nodearch }} -o docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-$VERSION.vsix | |
- name: actions/upload-artifact@v4 (refs/tags/v) | |
uses: actions/upload-artifact@v4 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
name: docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix | |
path: vscode-extension/docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix | |
if-no-files-found: error | |
- uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 https://github.com/softprops/action-gh-release/commit/c062e08bd532815e2082a85e87e3ef29c3e6d191 | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: vscode-extension/docker-vscode-extension-${{ matrix.os }}-${{ matrix.nodearch }}-${{ steps.set-variables.outputs.VERSION }}.vsix |