From 9535b78622fcc0cc5fff906b16edf9023fb7eee4 Mon Sep 17 00:00:00 2001 From: Arindy Date: Sat, 1 Mar 2025 19:28:34 +0100 Subject: [PATCH] initial ci --- .github/workflows/ci.yaml | 59 +++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..33e993a --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,59 @@ +name: ci +on: [ push, pull_request ] + +jobs: + ci: + runs-on: ubuntu-latest + + permissions: + contents: read + pull-requests: write + statuses: write + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - id: version + name: version + run: | + version=`npm --silent run version` + echo "VERSION=$version" >> ${GITHUB_OUTPUT} + + - name: echo version + run: echo ${{ steps.version.outputs.VERSION }} + + - name: npm install + run: npm install + - name: build + run: npm run build + + - name: zip release + if: github.ref_name == 'main' + working-directory: dist + run: zip -r release-${{ steps.version.outputs.VERSION }}.zip . + + - name: create tag + if: github.ref_name == 'main' + run: | + git config user.email "ci@git.arindy.de" + git config user.name "gitea" + git tag ${{ steps.version.outputs.VERSION }} -m "release ${{ steps.version.outputs.VERSION }}" +# new version +# +# git add ./package.json +# git commit -m "[no ci] prepare new Version" + git push origin main + git push origin ${{ steps.version.outputs.VERSION }} + + - uses: ncipollo/release-action@v1 + with: + artifacts: "dist/release-${{ steps.version.outputs.VERSION }}.zip" + tag: ${{ steps.version.outputs.VERSION }} + artifactErrorsFailBuild: true + artifactContentType: 'zip' + generateReleaseNotes: 'true' diff --git a/package.json b/package.json index b28df49..5677e5e 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build": "npm run clean && tsc && vite build", "watch": "tsc && vite build --watch", "copy": "sudo rsync -avP dist/ .foundry/data/Data/modules/dice-tower/", + "version": "echo $npm_package_version", "buildCopy": "npm run build && npm run copy" }, "devDependencies": {