From a7b5b6c3150f3c0db9d5b253c6bc13b5a70a57bb Mon Sep 17 00:00:00 2001 From: jusax23 Date: Sun, 25 Feb 2024 19:53:22 +0100 Subject: [PATCH] release actions --- .gitea/workflows/action_push.yml | 11 ++++++ .gitea/workflows/action_tag.yml | 16 +++++++++ .gitea/workflows/release_amd.yml | 36 ++++++++++++++++++++ .gitea/workflows/release_code.yml | 43 ++++++++++++++++++++++++ .gitea/workflows/{test.yaml => test.yml} | 5 ++- src/api/acts/login.ts | 2 ++ 6 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/action_push.yml create mode 100644 .gitea/workflows/action_tag.yml create mode 100644 .gitea/workflows/release_amd.yml create mode 100644 .gitea/workflows/release_code.yml rename .gitea/workflows/{test.yaml => test.yml} (94%) diff --git a/.gitea/workflows/action_push.yml b/.gitea/workflows/action_push.yml new file mode 100644 index 0000000..7e2406a --- /dev/null +++ b/.gitea/workflows/action_push.yml @@ -0,0 +1,11 @@ +name: Push Action + +on: + push: + branches: + - '!**' + +jobs: + test: + uses: ./.gitea/workflows/test.yml + diff --git a/.gitea/workflows/action_tag.yml b/.gitea/workflows/action_tag.yml new file mode 100644 index 0000000..6efed72 --- /dev/null +++ b/.gitea/workflows/action_tag.yml @@ -0,0 +1,16 @@ +name: Tag Action + +on: + push: + tags: + - v* + +jobs: + test: + uses: ./.gitea/workflows/test.yml + release_code: + needs: test + uses: ./.gitea/workflows/release_code.yml + release_amd: + needs: [test, release_code] + uses: ./.gitea/workflows/release_amd.yml \ No newline at end of file diff --git a/.gitea/workflows/release_amd.yml b/.gitea/workflows/release_amd.yml new file mode 100644 index 0000000..0a1ecb5 --- /dev/null +++ b/.gitea/workflows/release_amd.yml @@ -0,0 +1,36 @@ +name: Outbag AMD Release + +on: + workflow_call: + inputs: + secrets: + + +jobs: + release-amd: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: npm ci + + - name: Build + run: | + mkdir build + npm run bundleRelease + + - name: Build AMD + run: | + npm run build-amd + mkdir upload + cp build/bin/* upload + + - name: Create Release AMD + id: gitea-release-amd + uses: https://gitea.com/actions/release-action@main + with: + files: | + upload/** + api_key: '${{ secrets.RELEASE_TOKEN }}' diff --git a/.gitea/workflows/release_code.yml b/.gitea/workflows/release_code.yml new file mode 100644 index 0000000..f1f10cc --- /dev/null +++ b/.gitea/workflows/release_code.yml @@ -0,0 +1,43 @@ +name: Outbag Code release + +on: + workflow_call: + inputs: + secrets: + +jobs: + release-code: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: npm ci + + - name: Build + run: | + mkdir build + npm run prepublish + + - name: Build Code + run: | + apt-get update + apt-get install zip tar -y + mkdir outbag_server + mkdir outbag_server/dist + mkdir upload + cp -r dist/* outbag_server/dist + cp package.json outbag_server + cp package-lock.json outbag_server + cp readme.md outbag_server + zip -r upload/OutbagServer.zip outbag_server/* + tar -czvf upload/OutbagServer.tar.gz outbag_server/* + + - name: Create Release Code + id: gitea-release-code + uses: https://gitea.com/actions/release-action@main + with: + files: | + upload/** + api_key: '${{ secrets.RELEASE_TOKEN }}' diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yml similarity index 94% rename from .gitea/workflows/test.yaml rename to .gitea/workflows/test.yml index 7a6c119..76b44ac 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yml @@ -1,6 +1,9 @@ name: Outbag Tests -on: [push] +on: + workflow_call: + inputs: + secrets: jobs: test: diff --git a/src/api/acts/login.ts b/src/api/acts/login.ts index 7a08934..169b2fc 100644 --- a/src/api/acts/login.ts +++ b/src/api/acts/login.ts @@ -171,6 +171,7 @@ export const remote1: Act = { var tagAcert = `${data.name}@${server.host}:${server.port}-${data.publicKey}`; if (!(await verify(tagAcert, data.sign, cert))) { client.suspect(); + console.log("sig"); aws("error", act_error.SIGNATURE); return; } @@ -182,6 +183,7 @@ export const remote1: Act = { client.remoteKey = data.publicKey; aws("ok", { challenge: client.challenge }); } catch (e) { + console.log("err: ", e); client.suspect(); aws("error", act_error.SIGNATURE); }