diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4aa630d..59b52cba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,41 +2,18 @@ name: Release on: push: - branches: - - master + tags: + - v*.*.* jobs: release: name: Release runs-on: ubuntu-latest steps: - - name: Checkout Repo + - name: Checkout uses: actions/checkout@v3 - with: - # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits - fetch-depth: 0 - - - name: Setup pnpm - uses: pnpm/action-setup@v2 - with: - version: latest - - - name: Setup Node.js 16 - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: pnpm - - - name: Install Dependencies - run: pnpm i - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 + - name: Release + uses: softprops/action-gh-release@v1 with: - # This expects you to have a script called release which does a build for your packages and calls changeset publish - publish: pnpm release - commit: 'chore: release vscode-mdx' - title: 'chore: release vscode-mdx' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + body_path: ${{ github.workspace }}/CHANGELOG.md diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 00000000..b1c79471 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,44 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: latest + + - name: Setup Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: pnpm + + - name: Install Dependencies + run: pnpm i + + - name: Create Release Pull Request + id: changesets + uses: changesets/action@v1 + with: + commit: 'chore: release vscode-mdx' + title: 'chore: release vscode-mdx' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Push tags + if: steps.changesets.outputs.hasChangesets == 'false' + run: git push --follow-tags diff --git a/package.json b/package.json index 5b7c75ad..9c8e018b 100644 --- a/package.json +++ b/package.json @@ -57,8 +57,7 @@ ], "scripts": { "lint": "eslint . --cache -f friendly", - "prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0", - "release": "changeset publish" + "prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0" }, "devDependencies": { "@1stg/common-config": "^6.0.0",