├── LICENSE └── .github └── workflows ├── vscode-web.yml └── golang-cli-build.yml /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Jeff Lindsay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/vscode-web.yml: -------------------------------------------------------------------------------- 1 | name: Build VSCode Web 2 | on: 3 | workflow_call: 4 | inputs: 5 | path: 6 | required: true 7 | type: string 8 | artifact-name: 9 | required: false 10 | type: string 11 | default: vscode-web 12 | jobs: 13 | detect: 14 | name: Detect changes 15 | runs-on: ubuntu-latest 16 | outputs: 17 | changed: ${{ steps.changes.outputs.vscode }} 18 | steps: 19 | - uses: actions/checkout@v4 20 | - uses: dorny/paths-filter@v2 21 | id: changes 22 | with: 23 | filters: | 24 | vscode: 25 | - "${{ inputs.path }}/**" 26 | 27 | build: 28 | name: Build for web 29 | needs: detect 30 | if: needs.detect.outputs.changed == 'true' 31 | runs-on: ubuntu-latest 32 | permissions: 33 | contents: read 34 | packages: write 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v3 38 | 39 | - name: Set up Docker Buildx 40 | uses: docker/setup-buildx-action@v3 41 | 42 | - name: Login to GitHub Container Registry 43 | uses: docker/login-action@v3 44 | with: 45 | registry: ghcr.io 46 | username: ${{ github.actor }} 47 | password: ${{ secrets.GITHUB_TOKEN }} 48 | 49 | - name: Build VSCode Web and push to GHCR 50 | uses: docker/build-push-action@v5 51 | with: 52 | context: ${{ inputs.path }} 53 | push: true 54 | tags: ghcr.io/${{ github.repository }}:${{ inputs.artifact-name }} 55 | 56 | 57 | upload: 58 | name: Upload artifact 59 | needs: [detect, build] 60 | if: always() && needs.detect.result == 'success' 61 | runs-on: ubuntu-latest 62 | steps: 63 | - name: Pull from GitHub Container Registry 64 | run: | 65 | docker run --rm -v $(pwd):/out ghcr.io/${{ github.repository }}:${{ inputs.artifact-name }} 66 | mkdir -p _artifact 67 | unzip vscode-web.zip -d _artifact 68 | 69 | - name: Upload artifact 70 | uses: actions/upload-artifact@v4 71 | with: 72 | name: ${{ inputs.artifact-name }} 73 | path: _artifact 74 | -------------------------------------------------------------------------------- /.github/workflows/golang-cli-build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_call: 4 | inputs: 5 | bin-name: 6 | required: true 7 | type: string 8 | go-version: 9 | required: true 10 | type: string 11 | default: '1.23.1' 12 | pre-build-script: 13 | required: false 14 | type: string 15 | needs-artifact: 16 | required: false 17 | type: string 18 | linux-386: 19 | required: false 20 | type: boolean 21 | default: false 22 | secrets: 23 | apple_signing_csv: 24 | description: Apple developer signing data 25 | env: 26 | BIN_NAME: ${{ inputs.bin-name }} 27 | GO_VERSION: ${{ inputs.go-version }} 28 | SIGNING_CSV: ${{ secrets.apple_signing_csv }} 29 | jobs: 30 | build-windows: 31 | runs-on: ubuntu-latest 32 | name: Windows 33 | env: 34 | DIST_DIR: dist 35 | DIST_OS: windows 36 | DIST_ARCH: arm64 amd64 37 | steps: 38 | - name: Checkout 39 | uses: actions/checkout@v3 40 | 41 | - name: Set up Go 42 | uses: actions/setup-go@v4 43 | with: 44 | go-version: ${{ env.GO_VERSION }} 45 | check-latest: true 46 | 47 | - name: Download ${{ inputs.needs-artifact }} artifact 48 | if: ${{ inputs.needs-artifact != '' }} 49 | uses: actions/download-artifact@v4 50 | with: 51 | name: ${{ inputs.needs-artifact }} 52 | path: _artifact 53 | 54 | - name: Run pre-build script 55 | if: ${{ inputs.pre-build-script != '' }} 56 | run: ${{ inputs.pre-build-script }} 57 | 58 | - name: Build project 59 | run: make dist 60 | 61 | - name: Prepare arm64 artifact 62 | run: mv dist/*_arm64 ./${BIN_NAME} 63 | 64 | - name: Upload arm64 artifact 65 | uses: actions/upload-artifact@v4 66 | with: 67 | name: ${{ env.BIN_NAME }}-windows-arm64 68 | path: ${{ env.BIN_NAME }} 69 | 70 | - name: Prepare amd64 artifact 71 | run: mv dist/*_amd64 ./${BIN_NAME} 72 | 73 | - name: Upload amd64 artifact 74 | uses: actions/upload-artifact@v4 75 | with: 76 | name: ${{ env.BIN_NAME }}-windows-amd64 77 | path: ${{ env.BIN_NAME }} 78 | 79 | build-linux: 80 | runs-on: ubuntu-latest 81 | name: Linux 82 | env: 83 | DIST_DIR: dist 84 | DIST_OS: linux 85 | DIST_ARCH: arm64 amd64${{ inputs.linux-386 && ' 386' || '' }} 86 | steps: 87 | - name: Checkout 88 | uses: actions/checkout@v3 89 | 90 | - name: Set up Go 91 | uses: actions/setup-go@v4 92 | with: 93 | go-version: ${{ env.GO_VERSION }} 94 | check-latest: true 95 | 96 | - name: Download ${{ inputs.needs-artifact }} artifact 97 | if: ${{ inputs.needs-artifact != '' }} 98 | uses: actions/download-artifact@v4 99 | with: 100 | name: ${{ inputs.needs-artifact }} 101 | path: _artifact 102 | 103 | - name: Run pre-build script 104 | if: ${{ inputs.pre-build-script != '' }} 105 | run: ${{ inputs.pre-build-script }} 106 | 107 | - name: Build project 108 | run: make dist 109 | 110 | - name: Prepare arm64 artifact 111 | run: mv dist/*_arm64 ./${BIN_NAME} 112 | 113 | - name: Upload arm64 artifact 114 | uses: actions/upload-artifact@v4 115 | with: 116 | name: ${{ env.BIN_NAME }}-linux-arm64 117 | path: ${{ env.BIN_NAME }} 118 | 119 | - name: Prepare amd64 artifact 120 | run: mv dist/*_amd64 ./${BIN_NAME} 121 | 122 | - name: Upload amd64 artifact 123 | uses: actions/upload-artifact@v4 124 | with: 125 | name: ${{ env.BIN_NAME }}-linux-amd64 126 | path: ${{ env.BIN_NAME }} 127 | 128 | - name: Prepare 386 artifact 129 | if: ${{ inputs.linux-386 }} 130 | run: mv dist/*_386 ./${BIN_NAME} 131 | 132 | - name: Upload 386 artifact 133 | if: ${{ inputs.linux-386 }} 134 | uses: actions/upload-artifact@v4 135 | with: 136 | name: ${{ env.BIN_NAME }}-linux-386 137 | path: ${{ env.BIN_NAME }} 138 | 139 | build-darwin-arm64: 140 | runs-on: macos-latest 141 | name: Darwin (arm64) 142 | env: 143 | DIST_DIR: dist 144 | DIST_OS: darwin 145 | DIST_ARCH: arm64 146 | steps: 147 | - name: Checkout 148 | uses: actions/checkout@v3 149 | 150 | - name: Setup Apple signing 151 | run: | 152 | export SIGNING_CERTIFICATE=$(echo "$SIGNING_CSV" | cut -d',' -f1) 153 | export SIGNING_CERT_PASSWORD=$(echo "$SIGNING_CSV" | cut -d',' -f2) 154 | export AC_API_KEY_ID=$(echo "$SIGNING_CSV" | cut -d',' -f3) 155 | export AC_ISSUER_ID=$(echo "$SIGNING_CSV" | cut -d',' -f4) 156 | export AC_PRIVATE_KEY=$(echo "$SIGNING_CSV" | cut -d',' -f5) 157 | echo "$SIGNING_CERTIFICATE" | base64 --decode > cert.p12 158 | security create-keychain -p "" build.keychain 159 | security default-keychain -s build.keychain 160 | security unlock-keychain -p "" build.keychain 161 | security import cert.p12 -k build.keychain -P "$SIGNING_CERT_PASSWORD" -T /usr/bin/codesign 162 | security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain 163 | echo "$AC_PRIVATE_KEY" | base64 --decode > private_key.p8 164 | xcrun notarytool store-credentials --key private_key.p8 \ 165 | --key-id "$AC_API_KEY_ID" --issuer "$AC_ISSUER_ID" ac-profile 166 | 167 | - name: Set up Go 168 | uses: actions/setup-go@v4 169 | with: 170 | go-version: ${{ env.GO_VERSION }} 171 | check-latest: true 172 | 173 | - name: Download ${{ inputs.needs-artifact }} artifact 174 | if: ${{ inputs.needs-artifact != '' }} 175 | uses: actions/download-artifact@v4 176 | with: 177 | name: ${{ inputs.needs-artifact }} 178 | path: _artifact 179 | 180 | - name: Run pre-build script 181 | if: ${{ inputs.pre-build-script != '' }} 182 | run: ${{ inputs.pre-build-script }} 183 | 184 | - name: Build project 185 | run: | 186 | make dist 187 | mv dist/*_arm64 ./${BIN_NAME} 188 | 189 | - name: Sign 190 | run: | 191 | codesign --timestamp --options runtime --sign "Developer ID Application" ./${BIN_NAME} 192 | 193 | - name: Notarize 194 | run: | 195 | zip ${BIN_NAME}.zip ${BIN_NAME} 196 | xcrun notarytool submit ${BIN_NAME}.zip --keychain-profile ac-profile --wait 197 | 198 | - name: Upload artifact 199 | uses: actions/upload-artifact@v4 200 | with: 201 | name: ${{ env.BIN_NAME }}-darwin-arm64 202 | path: ${{ env.BIN_NAME }} 203 | 204 | build-darwin-amd64: 205 | runs-on: macos-13 206 | name: Darwin (amd64) 207 | env: 208 | DIST_DIR: dist 209 | DIST_OS: darwin 210 | DIST_ARCH: amd64 211 | steps: 212 | - name: Checkout 213 | uses: actions/checkout@v3 214 | 215 | - name: Setup Apple signing 216 | run: | 217 | export SIGNING_CERTIFICATE=$(echo "$SIGNING_CSV" | cut -d',' -f1) 218 | export SIGNING_CERT_PASSWORD=$(echo "$SIGNING_CSV" | cut -d',' -f2) 219 | export AC_API_KEY_ID=$(echo "$SIGNING_CSV" | cut -d',' -f3) 220 | export AC_ISSUER_ID=$(echo "$SIGNING_CSV" | cut -d',' -f4) 221 | export AC_PRIVATE_KEY=$(echo "$SIGNING_CSV" | cut -d',' -f5) 222 | echo "$SIGNING_CERTIFICATE" | base64 --decode > cert.p12 223 | security create-keychain -p "" build.keychain 224 | security default-keychain -s build.keychain 225 | security unlock-keychain -p "" build.keychain 226 | security import cert.p12 -k build.keychain -P "$SIGNING_CERT_PASSWORD" -T /usr/bin/codesign 227 | security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain 228 | echo "$AC_PRIVATE_KEY" | base64 --decode > private_key.p8 229 | xcrun notarytool store-credentials --key private_key.p8 \ 230 | --key-id "$AC_API_KEY_ID" --issuer "$AC_ISSUER_ID" ac-profile 231 | 232 | - name: Set up Go 233 | uses: actions/setup-go@v4 234 | with: 235 | go-version: ${{ env.GO_VERSION }} 236 | check-latest: true 237 | 238 | - name: Download ${{ inputs.needs-artifact }} artifact 239 | if: ${{ inputs.needs-artifact != '' }} 240 | uses: actions/download-artifact@v4 241 | with: 242 | name: ${{ inputs.needs-artifact }} 243 | path: _artifact 244 | 245 | - name: Run pre-build script 246 | if: ${{ inputs.pre-build-script != '' }} 247 | run: ${{ inputs.pre-build-script }} 248 | 249 | - name: Build project 250 | run: | 251 | make dist 252 | mv dist/*_amd64 ./${BIN_NAME} 253 | 254 | - name: Sign 255 | run: | 256 | codesign --timestamp --options runtime --sign "Developer ID Application" ./${BIN_NAME} 257 | 258 | - name: Notarize 259 | run: | 260 | zip ${BIN_NAME}.zip ${BIN_NAME} 261 | xcrun notarytool submit ${BIN_NAME}.zip --keychain-profile ac-profile --wait 262 | 263 | - name: Upload artifact 264 | uses: actions/upload-artifact@v4 265 | with: 266 | name: ${{ env.BIN_NAME }}-darwin-amd64 267 | path: ${{ env.BIN_NAME }} 268 | --------------------------------------------------------------------------------