From ea663cf13eee8b57baf643e988d383e3349d09c3 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Sun, 10 Nov 2024 00:29:08 +0000 Subject: [PATCH] forgejo test --- .forgejo/workflows/deploy.yml | 28 ++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/deploy.yml diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..63eeb23 --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,28 @@ +on: + push: + branches: + - master + + +jobs: + deploy: + runs-on: arch + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Install dependencies + run: time npm install + - name: Run Tests + run: npm run test -- --ignore-only + - name: Deply + run: | + CURR_VER=$(cat package.json | jq -r .version) + echo "Checking https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases for version v${CURR_VER}" + curl -s -X GET -H "Authorization: token ${{ secrets.deploytoken }}" https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases | grep -o "\"name\"\:\"v${CURR_VER}\"" > /dev/null + + if curl -s -X GET -H "Authorization: token ${{ secrets.deploytoken }}" https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases | grep -o "\"name\":\"v${CURR_VER}\"" > /dev/null; then + echo "Skipping ${{ gitea.job }} since $CURR_VER already exists"; + exit 0 + fi + + echo "Deploying version $CURR_VER to NPM" diff --git a/package.json b/package.json index e5fbd56..b58530e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Flaska is a micro web-framework for node. It is designed to be fast, simple and lightweight, and is distributed as a single file module with no dependencies.", "main": "flaska.mjs", "scripts": { - "test": "eltro", + "test": "eltro -r dot", "test:watch": "eltro -r dot -w test" }, "watch": {