diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml deleted file mode 100644 index 52c42375b..000000000 --- a/.github/workflows/semantic-release.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Release - -on: - push: - branches: - - 'release' - -jobs: - semantic-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Generate dot env - run: | - echo '${{ secrets.DOT_ENV }}' > .env - - name: Read version files - run: | - echo "NODE_VERSION=$(cat .node-version)" >> $GITHUB_ENV - - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Show environment information - run: | - echo "node: $(node -v)" - echo "yarn: $(yarn -v)" - - uses: actions/cache@v2 - with: - path: .yarn - key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn install - - run: yarn build - - run: yarn release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 640c3db29..492bdc879 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test +name: Test & Release on: pull_request: @@ -23,7 +23,7 @@ jobs: skip_after_successful_duplicate: true concurrent_skipping: always paths_ignore: '["**/*.md", "**/docs/**"]' - test: + test-and-release: needs: pre if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest @@ -49,3 +49,7 @@ jobs: - run: yarn typecheck - run: yarn lint - run: yarn build + - run: | + echo '${{ secrets.DOT_ENV }}' > .env + yarn release + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} diff --git a/.releaserc.json b/.releaserc.json index 0b32bee5d..2b50e0131 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,5 +1,5 @@ { - "branches": ["release"], + "branches": ["main"], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", @@ -7,7 +7,7 @@ "@semantic-release/npm", { "npmPublish": false, - "successComment": false + "successComment": true } ], "@semantic-release/github", diff --git a/README.md b/README.md index b43732c67..22e319508 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # PlantUML Visualizer -[![Test](https://github.com/WillBooster/plantuml-visualizer/workflows/Test/badge.svg)](https://github.com/WillBooster/plantuml-visualizer/actions?query=workflow%3ATest) -[![Release](https://github.com/WillBooster/plantuml-visualizer/workflows/Release/badge.svg)](https://github.com/WillBooster/plantuml-visualizer/actions?query=workflow%3ARelease) +[![Test & Release](https://github.com/WillBooster/plantuml-visualizer/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/plantuml-visualizer/actions/workflows/test.yml) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) :factory: A Chrome / Firefox extension for visualizing PlantUML descriptions.