From c9df1bf344418ea74acbc1b078f02acb9011f528 Mon Sep 17 00:00:00 2001 From: doprz <52579214+doprz@users.noreply.github.com> Date: Mon, 13 Oct 2025 14:12:29 -0500 Subject: [PATCH] feat(ci): add GHA jobs for release --- .changeset/chatty-needles-shave.md | 5 ++++ .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++- package.json | 3 ++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .changeset/chatty-needles-shave.md diff --git a/.changeset/chatty-needles-shave.md b/.changeset/chatty-needles-shave.md new file mode 100644 index 00000000..6ec3abda --- /dev/null +++ b/.changeset/chatty-needles-shave.md @@ -0,0 +1,5 @@ +--- +'ut-registration-plus': minor +--- + +Add CI/CD diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85c65749..e3234a08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,4 +16,48 @@ jobs: - uses: cachix/install-nix-action@v31 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - - run: nix flake check \ No newline at end of file + - run: nix flake check + + release: + name: Release + runs-on: ubuntu-latest + needs: nix-check + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout Repo + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Install Nix + uses: cachix/install-nix-action@v31 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Dependencies + run: nix develop .#full --command pnpm install + + - name: Create Release Pull Request or Publish + id: changesets + uses: changesets/action@v1 + with: + version: nix develop .#full --command pnpm run version + publish: nix develop .#full --command pnpm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create GitHub Release with Assets + if: steps.changesets.outputs.published == 'true' + uses: softprops/action-gh-release@v5 + with: + tag_name: v${{ steps.changesets.outputs.publishedPackages[0].version }} + name: Release v${{ steps.changesets.outputs.publishedPackages[0].version }} + files: | + packages/*.zip + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index 0b4cf567..e9cebfef 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,9 @@ "build:watch": "NODE_ENV='development' vite build --mode development -w", "zip": "pnpm build && pnpm gulp zipProdBuild", "zip:to-publish": "SENTRY_ENV='production' pnpm zip", + "changeset": "changeset", + "version": "changeset version && pnpm run generate-changelog", + "release": "pnpm run zip-to-publish && changeset tag", "prettier": "prettier src --check", "prettier:fix": "prettier src --write", "lint": "eslint src --ext ts,tsx --report-unused-disable-directives",