From ccb718c47c7e50797a35de59431e711dbd2afeaf Mon Sep 17 00:00:00 2001 From: Tristan Menzel Date: Wed, 25 Sep 2024 15:29:37 -0700 Subject: [PATCH] Enable commit lint and add placeholder release workflow --- .github/workflows/ci-all.yml | 47 +++++++++++++++++++++++++++ .github/workflows/pr.yml | 42 ++---------------------- .github/workflows/release.yml | 39 +++++++++++++++++++++++ .releaserc.json | 60 +++++++++++++++++++++++++++++++++++ 4 files changed, 149 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/ci-all.yml create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc.json diff --git a/.github/workflows/ci-all.yml b/.github/workflows/ci-all.yml new file mode 100644 index 00000000..8656f249 --- /dev/null +++ b/.github/workflows/ci-all.yml @@ -0,0 +1,47 @@ +on: + workflow_call: + + +jobs: + ci-algo-ts: + uses: ./.github/workflows/node-ci.yml + with: + node-version: 20.x + run-build: true + audit-script: npm run audit + working-directory: packages/algo-ts + upload-artifact-name: algo-ts + upload-artifact-path: ./packages/algo-ts/dist + ci-algo-ts-testing: + uses: ./.github/workflows/node-ci.yml + needs: + - ci-algo-ts + with: + download-artifact-name: algo-ts + download-artifact-path: ./packages/algo-ts/dist + node-version: 20.x + run-build: true + build-script: npm run build + audit-script: npm run audit + working-directory: packages/algo-ts-testing + upload-artifact-name: algo-ts-testing + upload-artifact-path: ./packages/algo-ts-testing/dist + ci-puya-ts: + uses: ./.github/workflows/node-ci.yml + needs: + - ci-algo-ts + - ci-algo-ts-testing + with: + download-artifact-pattern: algo-* + download-artifact-path: ./packages-temp + pre-run-script: mv packages-temp/algo-ts packages/algo-ts/dist && mv packages-temp/algo-ts-testing packages/algo-ts-testing/dist + node-version: 20.x + run-build: true + run-commit-lint: true + pre-test-script: | + pipx install algokit + algokit localnet start + build-script: npm run build + audit-script: npm run audit + upload-artifact-name: puya-ts + upload-artifact-path: ./dist diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f0b38751..59a9ab29 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,42 +13,6 @@ permissions: contents: read jobs: - ci-algo-ts: - uses: ./.github/workflows/node-ci.yml - with: - node-version: 20.x - run-build: true - audit-script: npm run audit - working-directory: packages/algo-ts - upload-artifact-name: algo-ts - upload-artifact-path: ./packages/algo-ts/dist - ci-algo-ts-testing: - uses: ./.github/workflows/node-ci.yml - needs: - - ci-algo-ts - with: - download-artifact-name: algo-ts - download-artifact-path: ./packages/algo-ts/dist - node-version: 20.x - run-build: true - build-script: npm run build - audit-script: npm run audit - working-directory: packages/algo-ts-testing - upload-artifact-name: algo-ts-testing - upload-artifact-path: ./packages/algo-ts-testing/dist - ci-puya-ts: - uses: ./.github/workflows/node-ci.yml - needs: - - ci-algo-ts - - ci-algo-ts-testing - with: - download-artifact-pattern: algo-* - download-artifact-path: ./packages-temp - pre-run-script: mv packages-temp/algo-ts packages/algo-ts/dist && mv packages-temp/algo-ts-testing packages/algo-ts-testing/dist - node-version: 20.x - run-build: true - pre-test-script: | - pipx install algokit - algokit localnet start - build-script: npm run build - audit-script: npm run audit + ci-all: + name: 'Build and test all packages' + uses: ./.github/workflows/ci-all.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7b1aa706 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Publish + +on: + push: + branches: + - compiler-alpha + - main + - release + workflow_dispatch: + +concurrency: release + +permissions: + contents: write + +jobs: + ci: + name: Build and test + uses: ./.github/workflows/ci-all.yml + + release: + name: Release + needs: ci + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Download package artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 00000000..23fb10a6 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,60 @@ +{ + "branches": [ + { + "name": "main", + "prerelease": "beta" + }, + { + "name": "release" + } + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "type": "build", + "release": "patch" + }, + { + "type": "chore", + "release": "patch" + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "build", + "section": "Dependencies and Other Build Updates", + "hidden": false + } + ] + } + } + ], + [ + "@semantic-release/npm", + { + "npmPublish": true, + "pkgRoot": "." + } + ], + "@semantic-release/github" + ] +}