diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a13cd34..d6baf32f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,6 @@ concurrency: group: release cancel-in-progress: true -env: - release: ${{ github.ref == 'refs/heads/main' && github.event.inputs.release == 'release' }} - jobs: release: runs-on: ubuntu-latest @@ -31,13 +28,13 @@ jobs: run: yarn install --frozen-lockfile --check-files - name: 📋 Dry-running release - if: ${{ !env.release }} + if: ${{ github.ref != 'refs/heads/main' || github.event.inputs.release != 'release' }} run: yarn semantic-release --dry-run env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 📋 Release code - if: ${{ env.release }} + if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.release == 'release' }} run: yarn semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc.js b/.releaserc.js index 5cd56e46..5efcda1f 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -34,9 +34,10 @@ module.exports = { }], '@semantic-release/changelog', ['@semantic-release/npm', { npmPublish: false }], + ["@semantic-release/exec", { publishCmd: 'yarn build' }], ['@semantic-release/git', { message: 'chore: create new release ${nextRelease.version}\n\n${nextRelease.notes}', - assets: ['package.json', 'CHANGELOG.md'], + assets: ['package.json', 'CHANGELOG.md', 'build/*'], }], '@semantic-release/github', ], diff --git a/package.json b/package.json index 6f594e84..29c67256 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ }, "devDependencies": { "@semantic-release/changelog": "^6.0.1", + "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", "@tsconfig/node16": "^1.0.2", "@types/jest": "^27.4.0", diff --git a/yarn.lock b/yarn.lock index a71aaa8c..175568c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1206,6 +1206,18 @@ resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-3.0.0.tgz#30a3b97bbb5844d695eb22f9d3aa40f6a92770c2" integrity sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw== +"@semantic-release/exec@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@semantic-release/exec/-/exec-6.0.3.tgz#d212fdf19633bdfb553de6cb6c7f8781933224db" + integrity sha512-bxAq8vLOw76aV89vxxICecEa8jfaWwYITw6X74zzlO0mc/Bgieqx9kBRz9z96pHectiTAtsCwsQcUyLYWnp3VQ== + dependencies: + "@semantic-release/error" "^3.0.0" + aggregate-error "^3.0.0" + debug "^4.0.0" + execa "^5.0.0" + lodash "^4.17.4" + parse-json "^5.0.0" + "@semantic-release/git@^10.0.1": version "10.0.1" resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-10.0.1.tgz#c646e55d67fae623875bf3a06a634dd434904498"