diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b970e5f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: release + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + src: + - "scripts/*" + - "src/*.ts" + - "styles/*.ts" + - "themes/*.ts" + - "vite.config.ts" + - "package.json" + + - name: Build theme + id: build + if: steps.changes.outputs.src == 'true' + run: | + npm install + npm run build + env: + GH_TOKEN: ${{ github.token }} + + - name: Upload css assets + if: steps.build.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: themes + path: dist/*.css + + - name: Upload templates assets + if: steps.build.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: templates + path: templates diff --git a/package.json b/package.json index bbca793..93373e1 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "format": "prettier --write .", "commit": "npm run lint && npm run format && npm run build", "version": "node scripts/version.cjs", - "install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install" + "install:clean": "npm cache clean --force && rm -rf node_modules package-lock.json && npm install", + "tr": "node scripts/translate.ts" }, "devDependencies": { "@babel/preset-typescript": "^7.28.4", diff --git a/scripts/translate.ts b/scripts/translate.ts new file mode 100644 index 0000000..84c8717 --- /dev/null +++ b/scripts/translate.ts @@ -0,0 +1,5 @@ +import * as dotenv from "dotenv"; + +dotenv.config({ quiet: true }); + +console.log(process.env.GITEA_PATH);