diff --git a/.github/workflows/multibuild.yaml b/.github/workflows/multibuild.yaml index 30932ace9..27fded25e 100644 --- a/.github/workflows/multibuild.yaml +++ b/.github/workflows/multibuild.yaml @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./packages/dart/sshnoports + working-directory: ./packages/dart strategy: matrix: platform: [linux/arm/v7, linux/arm64, linux/riscv64] @@ -92,14 +92,14 @@ jobs: - uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 - uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - run: | - docker buildx build -t atsigncompany/sshnptarball -f tools/Dockerfile.package \ + docker buildx build -t atsigncompany/sshnptarball -f sshnoports/tools/Dockerfile.package \ --platform ${{ matrix.platform }} -o type=tar,dest=bins.tar . - run: mkdir tarballs - run: tar -xvf bins.tar -C tarballs - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: ${{ matrix.output-name }}-upload - path: ./packages/dart/sshnoports/tarballs/${{ matrix.output-name }}.tgz + path: ./packages/dart/tarballs/${{ matrix.output-name }}.tgz if-no-files-found: error notify_on_completion: diff --git a/packages/dart/noports_core/pubspec.yaml b/packages/dart/noports_core/pubspec.yaml index 469a19135..9be4a265f 100644 --- a/packages/dart/noports_core/pubspec.yaml +++ b/packages/dart/noports_core/pubspec.yaml @@ -24,8 +24,6 @@ dependencies: socket_connector: ^2.0.1 uuid: ^3.0.7 -# dependency_overrides: - dev_dependencies: build_runner: ^2.4.6 build_version: ^2.1.1 diff --git a/packages/dart/sshnoports/tools/Dockerfile.package b/packages/dart/sshnoports/tools/Dockerfile.package index 73f6414d1..dc1332026 100644 --- a/packages/dart/sshnoports/tools/Dockerfile.package +++ b/packages/dart/sshnoports/tools/Dockerfile.package @@ -6,26 +6,27 @@ FROM atsigncompany/buildimage:automated@sha256:df2ef31dba19fa48cffe53cb2d2215148 WORKDIR /sshnoports COPY . . RUN set -eux; \ - case "$(dpkg --print-architecture)" in \ - amd64) ARCH="x64";; \ - armhf) ARCH="arm";; \ - arm64) ARCH="arm64";; \ - riscv64) ARCH="riscv64";; \ - esac; \ - mkdir -p sshnp/debug; \ - mkdir tarball; \ - dart pub get; \ - dart run build_runner build --delete-conflicting-outputs; \ - dart compile exe bin/activate_cli.dart -v -o sshnp/at_activate; \ - dart compile exe bin/sshnp.dart -v -o sshnp/sshnp; \ - dart compile exe bin/sshnpd.dart -v -o sshnp/sshnpd; \ - dart compile exe bin/srv.dart -v -o sshnp/srv; \ - dart compile exe bin/srvd.dart -v -o sshnp/srvd; \ - dart compile exe bin/srvd.dart -D ENABLE_SNOOP=true -v -o sshnp/debug/srvd; \ - cp -r bundles/core/* sshnp/; \ - cp -r bundles/shell/* sshnp/; \ - cp LICENSE sshnp/; \ - tar -cvzf tarball/sshnp-linux-${ARCH}.tgz sshnp + case "$(dpkg --print-architecture)" in \ + amd64) ARCH="x64";; \ + armhf) ARCH="arm";; \ + arm64) ARCH="arm64";; \ + riscv64) ARCH="riscv64";; \ + esac; \ + cd sshnoports; \ + mkdir -p sshnp/debug; \ + mkdir tarball; \ + dart pub get; \ + dart run build_runner build --delete-conflicting-outputs; \ + dart compile exe bin/activate_cli.dart -v -o sshnp/at_activate; \ + dart compile exe bin/sshnp.dart -v -o sshnp/sshnp; \ + dart compile exe bin/sshnpd.dart -v -o sshnp/sshnpd; \ + dart compile exe bin/srv.dart -v -o sshnp/srv; \ + dart compile exe bin/srvd.dart -v -o sshnp/srvd; \ + dart compile exe bin/srvd.dart -D ENABLE_SNOOP=true -v -o sshnp/debug/srvd; \ + cp -r bundles/core/* sshnp/; \ + cp -r bundles/shell/* sshnp/; \ + cp LICENSE sshnp/; \ + tar -cvzf tarball/sshnp-linux-${ARCH}.tgz sshnp FROM scratch -COPY --from=build /sshnoports/tarball/* / +COPY --from=build /sshnoports/sshnoports/tarball/* / diff --git a/tools/package-macos-arm64.sh b/tools/package-macos-arm64.sh index d39e3c3dc..e6f7f7fd9 100755 --- a/tools/package-macos-arm64.sh +++ b/tools/package-macos-arm64.sh @@ -11,33 +11,37 @@ ROOT_DIRECTORY="$SCRIPT_DIRECTORY/.." SRC_DIR="$ROOT_DIRECTORY/packages/dart/sshnoports" if [ "$#" -ne 0 ]; then - echo "Usage: $0" - exit 1 + echo "Usage: $0" + exit 1 fi if [ "$(uname)" != "Darwin" ]; then - echo "This script is only for macOS"; - exit 1; + echo "This script is only for macOS" + exit 1 fi if [ "$(uname -m)" != "arm64" ]; then - echo "This script can only be run on an Apple Silicon device"; - exit 1; + echo "This script can only be run on an Apple Silicon device" + exit 1 fi if [ -n "$FLUTTER_ROOT" ]; then - DART="$FLUTTER_ROOT/bin/dart" + DART="$FLUTTER_ROOT/bin/dart" else - DART=$(which dart) + DART=$(which dart) fi restore_backup_and_exit() { - mv "$SRC_DIR/pubspec_overrides.back.yaml" "$SRC_DIR/pubspec_overrides.yaml" - exit "$1" + mv "$SRC_DIR/pubspec_overrides.back.yaml" "$SRC_DIR/pubspec_overrides.yaml" + exit "$1" } -mv "$SRC_DIR/pubspec_overrides.yaml" "$SRC_DIR/pubspec_overrides.back.yaml" -eval "$DART pub get -C $SRC_DIR" || restore_backup_and_exit 1 +# Disabled backup code - we want to build using pubspec.lock dependencies +# +# mv "$SRC_DIR/pubspec_overrides.yaml" "$SRC_DIR/pubspec_overrides.back.yaml" +# eval "$DART pub get -C $SRC_DIR" || restore_backup_and_exit 1 + +eval "$DART pub get -C $SRC_DIR" || exit 1 OUTPUT_DIR_PATH="$ROOT_DIRECTORY/build/macos-arm64" OUTPUT_DIR="$OUTPUT_DIR_PATH/sshnp" @@ -52,10 +56,13 @@ eval "$DART compile exe -o $OUTPUT_DIR/srv $SRC_DIR/bin/srv.dart" eval "$DART compile exe -o $OUTPUT_DIR/at_activate $SRC_DIR/bin/activate_cli.dart" eval "$DART compile exe -o $OUTPUT_DIR/debug/srvd -D ENABLE_SNOOP=true $SRC_DIR/bin/srvd.dart" -cp -r "$SRC_DIR/bundles/core"/* "$OUTPUT_DIR/"; -cp -r "$SRC_DIR/bundles/shell"/* "$OUTPUT_DIR/"; -cp "$SRC_DIR"/LICENSE "$OUTPUT_DIR/"; +cp -r "$SRC_DIR/bundles/core"/* "$OUTPUT_DIR/" +cp -r "$SRC_DIR/bundles/shell"/* "$OUTPUT_DIR/" +cp "$SRC_DIR"/LICENSE "$OUTPUT_DIR/" "$SCRIPT_DIRECTORY/notarize-macos.sh" "$OUTPUT_DIR_PATH" sshnp-macos-arm64 -restore_backup_and_exit 0 +# Disabled backup code - we want to build using pubspec.lock dependencies +# +# restore_backup_and_exit 0 +exit 0