Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 43 additions & 3 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ jobs:
- label: Linux x64
runner: ubuntu-latest
package_dir: packages/cli-local-linux-x64
- label: Windows x64
runner: windows-latest
package_dir: packages/cli-local-win32-x64
# Windows is not part of the public release yet.
# - label: Windows x64
# runner: windows-latest
# package_dir: packages/cli-local-win32-x64
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: second-9r
Expand Down Expand Up @@ -63,33 +64,53 @@ jobs:

echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Check published payload version
id: package
shell: bash
run: |
PACKAGE_NAME="$(node -p "require('./${{ matrix.package_dir }}/package.json').name")"
VERSION="${{ steps.release.outputs.version }}"
echo "name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT"
if npm view "${PACKAGE_NAME}@${VERSION}" version --json >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "${PACKAGE_NAME}@${VERSION} already exists; skipping publish."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Set package version
if: steps.package.outputs.exists != 'true'
shell: bash
run: npm --prefix "${{ matrix.package_dir }}" pkg set version="${{ steps.release.outputs.version }}"

- name: Install dependencies
if: steps.package.outputs.exists != 'true'
shell: bash
run: |
npm ci --prefix apps/web
npm ci --prefix apps/worker
npm ci --prefix packages/cli

- name: Validate
if: steps.package.outputs.exists != 'true'
shell: bash
run: |
npm --prefix packages/cli run build
npm --prefix apps/web run typecheck
npm --prefix apps/worker run typecheck

- name: Build payload
if: steps.package.outputs.exists != 'true'
shell: bash
run: npm --prefix "${{ matrix.package_dir }}" run build

- name: Pack check
if: steps.package.outputs.exists != 'true'
shell: bash
run: cd "${{ matrix.package_dir }}" && npm pack --dry-run --ignore-scripts

- name: Publish payload
if: steps.package.outputs.exists != 'true'
shell: bash
run: cd "${{ matrix.package_dir }}" && npm publish --access public --ignore-scripts

Expand Down Expand Up @@ -122,24 +143,43 @@ jobs:

echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Check published launcher version
id: package
shell: bash
run: |
PACKAGE_NAME="$(node -p "require('./packages/cli/package.json').name")"
VERSION="${{ steps.release.outputs.version }}"
echo "name=$PACKAGE_NAME" >> "$GITHUB_OUTPUT"
if npm view "${PACKAGE_NAME}@${VERSION}" version --json >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "${PACKAGE_NAME}@${VERSION} already exists; skipping publish."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Set package version
if: steps.package.outputs.exists != 'true'
shell: bash
run: |
npm --prefix packages/cli pkg set version="${{ steps.release.outputs.version }}"
npm --prefix packages/cli install --package-lock-only --ignore-scripts

- name: Install dependencies
if: steps.package.outputs.exists != 'true'
shell: bash
run: npm ci --prefix packages/cli

- name: Validate
if: steps.package.outputs.exists != 'true'
shell: bash
run: npm --prefix packages/cli run build

- name: Pack check
if: steps.package.outputs.exists != 'true'
shell: bash
run: cd packages/cli && npm pack --dry-run --ignore-scripts

- name: Publish launcher
if: steps.package.outputs.exists != 'true'
shell: bash
run: cd packages/cli && npm publish --access public --ignore-scripts
6 changes: 3 additions & 3 deletions .github/workflows/release-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ jobs:
run: |
VERSION="${GITHUB_REF_NAME#v}"
TITLE="v${VERSION}"
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" artifacts/Second-mac-arm64.dmg artifacts/Second-mac-arm64.dmg.sha256 --clobber
if gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
gh release upload "$GITHUB_REF_NAME" artifacts/Second-mac-arm64.dmg artifacts/Second-mac-arm64.dmg.sha256 --repo "$GITHUB_REPOSITORY" --clobber
else
gh release create "$GITHUB_REF_NAME" artifacts/Second-mac-arm64.dmg artifacts/Second-mac-arm64.dmg.sha256 --title "$TITLE" --notes "Second ${VERSION}"
gh release create "$GITHUB_REF_NAME" artifacts/Second-mac-arm64.dmg artifacts/Second-mac-arm64.dmg.sha256 --repo "$GITHUB_REPOSITORY" --title "$TITLE" --notes "Second ${VERSION}"
fi
19 changes: 10 additions & 9 deletions packages/cli/bin/second.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ function resolvePayloadPackage() {
binName: "second-local",
};
}
if (runtimeId === "win32-x64") {
return {
runtimeId,
packageName: "@second-inc/cli-local-win32-x64",
binName: "second-local",
};
}
// Windows is not part of the public release yet.
// if (runtimeId === "win32-x64") {
// return {
// runtimeId,
// packageName: "@second-inc/cli-local-win32-x64",
// binName: "second-local",
// };
// }
return null;
}

Expand Down Expand Up @@ -416,11 +417,11 @@ function printUnsupportedPlatform() {
eyebrow: "unsupported platform",
title: "Second is not available here yet",
subtitle:
"The local installer currently ships for macOS, Linux x64, and Windows x64.",
"The local installer currently ships for macOS and Linux x64.",
quote: "\"Detected a runtime we do not package yet.\"",
rows: [
["detected", currentRuntimeId()],
["supported", "darwin-arm64, darwin-x64, linux-x64, win32-x64"],
["supported", "darwin-arm64, darwin-x64, linux-x64"],
],
tone: "error",
});
Expand Down
Loading