Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package standalone binaries via @vercel/pkg #343

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c828996
add package-standalone npm script to run vercel/pkg on the minified b…
trxcllnt Dec 23, 2022
9829ed9
update yarn.lock
trxcllnt Dec 23, 2022
dea73bc
copy scripts/updateUID.Dockerfile into standalone packages
trxcllnt Jan 3, 2023
e32c3b5
update tests to optionally execute the standalone binary instead of t…
trxcllnt Jan 3, 2023
7b16b80
update dev-containers.yml workflow to build, upload, and test the sta…
trxcllnt Jan 3, 2023
fb00be8
setup QEMU
trxcllnt Jan 3, 2023
4f7a744
fix typos
trxcllnt Jan 3, 2023
7716f15
run standalone binary tests on windows
trxcllnt Jan 3, 2023
4ab41ea
separate scripts for building each os/arch combo
trxcllnt Jan 4, 2023
873be77
update yarn.lock
trxcllnt Jan 4, 2023
6a4a539
update actions to build macos binaries, download artifact for testing…
trxcllnt Jan 4, 2023
7f6d4ae
build the pkgs on separate OS's
trxcllnt Jan 4, 2023
97c6f70
update registryCompatibilityOCI.test.ts
trxcllnt Jan 4, 2023
817a9b4
add package-standalone npm script to run vercel/pkg on the minified b…
trxcllnt Dec 23, 2022
8d4beea
update yarn.lock
trxcllnt Dec 23, 2022
dc37f6d
copy scripts/updateUID.Dockerfile into standalone packages
trxcllnt Jan 3, 2023
fc745df
update tests to optionally execute the standalone binary instead of t…
trxcllnt Jan 3, 2023
3210199
update dev-containers.yml workflow to build, upload, and test the sta…
trxcllnt Jan 3, 2023
3ec97a3
setup QEMU
trxcllnt Jan 3, 2023
a57398d
fix typos
trxcllnt Jan 3, 2023
9d51488
run standalone binary tests on windows
trxcllnt Jan 3, 2023
6177f68
separate scripts for building each os/arch combo
trxcllnt Jan 4, 2023
fd39253
update yarn.lock
trxcllnt Jan 4, 2023
1b5907d
update registryCompatibilityOCI.test.ts
trxcllnt Jan 4, 2023
1a8bc5a
Merge branch 'main' of github.com:devcontainers/cli into fea/pkg
trxcllnt Jan 21, 2023
6f4afce
Merge branch 'fea/pkg' into fea/pkg-workflows
trxcllnt Jan 21, 2023
2fb68ae
silence buffer ctor deprecation warnings
trxcllnt Jan 21, 2023
b146bb6
publish github releases with artifacts
trxcllnt Jan 22, 2023
9ff701f
build on older OS versions
trxcllnt Jan 24, 2023
6a1ecfc
cache bust on os change
trxcllnt Jan 24, 2023
6131899
Merge branch 'main' into fea/pkg
joshspicer Feb 7, 2023
a62cd9f
Merge branch 'fea/pkg' into fea/pkg-workflows
trxcllnt Feb 7, 2023
9ae26cb
ensure ts-node doesn't attempt to transpile node-pty tests
trxcllnt Feb 7, 2023
5c70bfa
Merge branch 'fea/pkg' into fea/pkg-workflows
trxcllnt Feb 7, 2023
132285f
Merge branch 'main' of github.com:devcontainers/cli into fea/pkg
trxcllnt Jun 6, 2023
fea1d81
add comment that COMPILE_FOR_PKG is inlined
trxcllnt Jun 6, 2023
f9e26da
add dist/node_modules to assets
trxcllnt Jun 6, 2023
e77ae41
Merge branch 'main' of github.com:devcontainers/cli into fea/pkg
trxcllnt Sep 26, 2023
e266aeb
rename dev-containers.yml
trxcllnt Sep 26, 2023
ab02fbb
restore original dev-containers.yml
trxcllnt Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build-chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ on:

jobs:
main:
if: github.repository == 'devcontainers/cli'
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: "microsoft/vscode-github-triage-actions"
persist-credentials: false
path: ./actions
- name: Install Actions
run: npm install --production --prefix ./actions
Expand Down
110 changes: 95 additions & 15 deletions .github/workflows/publish-dev-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,123 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
npm-publish:
type: boolean
default: false
description: "Publish to NPM"
make-release:
type: boolean
default: false
description: "Make GitHub Release"
draft-release:
type: boolean
default: false
description: "Make GitHub Draft Release"

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v1
if: github.repository == 'devcontainers/cli' && (github.event_name != 'workflow_dispatch' || inputs.npm-publish == true)
uses: actions/setup-node@v3
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
scope: '@devcontainers'

- name: Verify Versions
if: github.repository == 'devcontainers/cli' && (github.event_name != 'workflow_dispatch' || inputs.npm-publish == true)
shell: bash
run: |
node -e "
const packageRef = 'refs/tags/v' + require('./package.json').version;
const githubRef = '${{ github.ref }}';
if (packageRef !== githubRef && packageRef + '-pre-release' != githubRef) {
if (githubRef.includes(packageRef)) {
console.log('::error::' + 'Version Mismatch.', packageRef, githubRef);
throw Error('Version Mismatch');
}
"
- name: TGZ name
run: |
VERSION=$(jq -r '.version' < package.json)
echo "TGZ=devcontainers-cli-${VERSION}.tgz" | tee -a $GITHUB_ENV
echo "TGZ_UPLOAD=devcontainers-cli-${VERSION}-${GITHUB_SHA:0:8}.tgz" | tee -a $GITHUB_ENV
- name: Download TGZ
uses: dawidd6/action-download-artifact@6f8f427fb41886a66b82ea11a5a15d1454c79415

- name: Download Artifacts
uses: dawidd6/action-download-artifact@v2
with:
commit: ${{ github.sha }}
workflow: dev-containers.yml
workflow_conclusion: success
commit: ${{ github.sha }}
name: ${{ env.TGZ_UPLOAD }}
path: .
- name: Publish TGZ
run: npm publish ${TGZ} --access public

- name: Env
shell: bash
run: |
VER=$(cat package.json | jq -r '.version')
echo "VER=${VER}" >> $GITHUB_ENV;
echo "SLUG=${VER}-${GITHUB_SHA:0:8}" >> $GITHUB_ENV;

TAG="${{ github.ref }}";
if [[ "${{ github.event_name }}" != 'workflow_dispatch' ]]; then
TAG="${TAG#refs/tags/}";
else
TAG="$(git describe --abbrev=0 --tags)";
fi
echo "TAG=${TAG}" >> $GITHUB_ENV;

if [[ "$TAG" =~ "-pre-release" ]]; then
echo "PRERELEASE=true" >> $GITHUB_ENV;
else
echo "PRERELEASE=false" >> $GITHUB_ENV;
fi

find . -type f \( \
-name "devcontainer-linux-x64" \
-or -name "devcontainer-linux-arm64" \
-or -name "devcontainer-macos-x64" \
-or -name "devcontainer-macos-arm64" \
-or -name "devcontainer-win-x64.exe" \
-or -name "devcontainer-win-arm64.exe" \
-or -name "devcontainers-cli-0.29.0.tgz" \
\) -exec mv {} . \;

- name: Publish npm package
if: github.repository == 'devcontainers/cli' && (github.event_name != 'workflow_dispatch' || inputs.npm-publish == true)
run: npm publish devcontainers-cli-${VER}.tgz --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Upload release smoketest artifacts
if: github.event_name == 'workflow_dispatch' && inputs.make-release != true && inputs.draft-release != true
uses: actions/upload-artifact@v3
with:
name: devcontainers-cli-${{ env.SLUG }}
path: |
devcontainer-linux-x64
devcontainer-linux-arm64
devcontainer-macos-x64
devcontainer-macos-arm64
devcontainer-win-x64.exe
devcontainer-win-arm64.exe
devcontainers-cli-${{ env.VER }}.tgz

- name: Create GitHub release
if: github.event_name != 'workflow_dispatch' || inputs.make-release == true || inputs.draft-release == true
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
tag_name: ${{ env.TAG }}
repository: ${{ github.repository }}
prerelease: ${{ env.PRERELEASE == 'true' }}
draft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft-release == true }}
files: |
devcontainer-linux-x64
devcontainer-linux-arm64
devcontainer-macos-x64
devcontainer-macos-arm64
devcontainer-win-x64.exe
devcontainer-win-arm64.exe
devcontainers-cli-${{ env.VER }}.tgz
Loading