CD #94
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: CD | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 0 * * 0 | |
jobs: | |
follow: | |
name: Follow dprint-plugin-typescript Updates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
registry-url: "https://registry.npmjs.org" | |
always-auth: true | |
- name: Install Packages | |
run: npm ci | |
- name: Update dprint-plugin-typescript if needed | |
id: updateStep | |
run: npx ts-node scripts/update-if-needed | |
- name: Test | |
run: | | |
npm run -s test:ci | |
npm run -s lint -- --fix | |
if: ${{ success() && steps.updateStep.outputs.updated == 'yes' }} | |
- name: Version Bump | |
id: versionStep | |
run: | | |
git config user.name ben12 | |
git config user.email [email protected] | |
git add . | |
git commit -m "🚀 Update ${{ steps.updateStep.outputs.dprint_plugin_updates }}" | |
npm version ${{ steps.updateStep.outputs.kind }} --no-git-tag-version | |
if: ${{ success() && steps.updateStep.outputs.updated == 'yes' }} | |
- name: Publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
if: ${{ success() && steps.updateStep.outputs.updated == 'yes' }} | |
- name: Create Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: >- | |
gh release create v${{ steps.versionStep.outputs.version }} | |
--notes "🚀 Update ${{ steps.updateStep.outputs.dprint_plugin_updates }}" | |
--title "Version ${{ steps.versionStep.outputs.version }}" | |
if: ${{ success() && steps.versionStep.outputs.version }} |