feat: added comprehensive guide #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: Create new version & CHANGELOG.md | |
id: chkVersion | |
run: pnpm run semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print next version | |
run: | | |
echo ${{ steps.chkVersion.outputs.NEXT_RELEASE_VERSION }} | |
echo ${{ steps.chkVersion.outputs.NEXT_RELEASE_NOTES }} | |
echo "The next version is ${{ steps.chkVersion.outputs.NEXT_RELEASE_VERSION && steps.chkVersion.outputs.NEXT_RELEASE_VERSION || 'N/A' }}" >> $GITHUB_STEP_SUMMARY | |
# - name: Update version files and create tag | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# run: | | |
# pnpm run version | |
# git add . | |
# - name: Build plugin | |
# run: | | |
# pnpm run build | |
- name: Publish | |
run: pnpm run deploy | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
# - name: Create release | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# run: | | |
# VERSION=$(node -p "require('./package.json').version") | |
# gh release create "$VERSION" \ | |
# --title="Release v$VERSION" \ | |
# main.js manifest.json styles.css | |
- name: Push Tag and staged Files | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
VERSION=$(node -p "require('./package.json').version") | |
echo "Updating version files to $VERSION" | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -am "chore(release): v${{ steps.chkVersion.outputs.NEXT_RELEASE_VERSION }} [skip ci] ${{ steps.chkVersion.outputs.NEXT_RELEASE_NOTES }}" | |
git tag -a $VERSION -m "$VERSION" | |
git push --follow-tags |