Skip to content

Commit

Permalink
Merge branch 'trunk' into xlin-sshnoports-400
Browse files Browse the repository at this point in the history
  • Loading branch information
Xlin123 committed Nov 23, 2023
2 parents 8516e9e + e116787 commit b0bf844
Show file tree
Hide file tree
Showing 152 changed files with 7,158 additions and 3,998 deletions.
20 changes: 17 additions & 3 deletions .github/composite/setup_entrypoints/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ inputs:
devicename:
description: Unique sshnp devicename
required: true
args:
description: Arguments to pass to the entrypoint
required: false

runs:
using: composite
Expand All @@ -30,15 +33,26 @@ runs:
working-directory: tests/end2end_tests/contexts/_init_
run: |
case "${{ inputs.sshnp }}" in
"installer")
installer|v3.*.*)
# legacy client
args="-s id_ed25519.pub -v"
entrypoint_filename="sshnp_installer_entrypoint.sh"
;;
*)
entrypoint_filename="sshnp_entrypoint.sh"
case "${{inputs.sshnpd}}" in
installer|v3.*.*)
# v4 client, legacy daemon
args="-i ~/.ssh/id_ed25519 -s -v --legacy-daemon"
;;
*)
# v4 client, v4 daemon
args="-i ~/.ssh/id_ed25519 -s -v"
;;
esac
;;
esac
echo "entrypoint_filename: $entrypoint_filename"
./setup-sshnp-entrypoint.sh ${{ inputs.devicename }} ${{ inputs.sshnp_atsign }} ${{ inputs.sshnpd_atsign }} ${{ inputs.sshrvd_atsign }} "$entrypoint_filename"
./setup-sshnp-entrypoint.sh ${{ inputs.devicename }} ${{ inputs.sshnp_atsign }} ${{ inputs.sshnpd_atsign }} ${{ inputs.sshrvd_atsign }} "$entrypoint_filename" "$args ${{ inputs.args }}"
- name: Setup NPD entrypoint
shell: bash
Expand Down
19 changes: 19 additions & 0 deletions .github/composite/verify_cli_tags/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: verify_cli_tags
description: |
Ensures that the tag of sshnoports matches the tag of the git ref.
runs:
using: composite
steps:
- name: Ensure pubspec.yaml matches git ref (if current git ref is a version tag)
shell: bash
if: startsWith(github.ref, 'refs/tags/v')
working-directory: ./packages/sshnoports
run: |
REF=${{ github.ref }}
TAG=${REF:10}
PUBSPEC_TAG="v$(egrep -o '^version: (.*)$' pubspec.yaml | cut -d':' -f2 | tr -d '[:space:]')"
if [ "$TAG" != "$PUBSPEC_TAG" ]; then
echo "Tag $TAG does not match version in pubspec.yaml: $PUBSPEC_TAG"
exit 1
fi
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9
uses: github/codeql-action/init@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -60,7 +60,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9
uses: github/codeql-action/autobuild@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -73,6 +73,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9
uses: github/codeql-action/analyze@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
with:
category: "/language:${{matrix.language}}"
6 changes: 3 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: 'Dependency Review'
uses: actions/dependency-review-action@6c5ccdad469c9f8a2996bfecaec55a631a347034 # v3.1.0
uses: actions/dependency-review-action@7bbfa034e752445ea40215fff1c3bf9597993d3f # v3.1.3
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub_promote_to_latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
Expand Down
20 changes: 5 additions & 15 deletions .github/workflows/dockerhub_sshnpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Ensure version matches tag
if: startsWith(github.ref, 'refs/tags/v')
working-directory: ./packages/sshnoports
run: |
# check version.dart
REF=${{ github.ref }}
TAG=${REF:10}
DART_TAG="v$(grep -Po '^const String version = "(.*)";' lib/version.dart | cut -d'"' -f2)"
if [ "$TAG" != "$DART_TAG" ]; then
echo "Tag $TAG does not match version in version.dart: $DART_TAG"
exit 1
fi
# verify tags
- uses: ./.github/composite/verify_cli_tags

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
Expand All @@ -49,9 +39,9 @@ jobs:
- name: Get version
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: ./packages/sshnoports
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
Expand Down
Loading

0 comments on commit b0bf844

Please sign in to comment.