CI for build and release #21
This file contains hidden or 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: Version and Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| version: | |
| if: github.repository == 'ashuvssut/github-issue-alert' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Force Git to use HTTPS instead of SSH | |
| run: | | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| git config --global url."https://github.com/".insteadOf "ssh://git@github.com/" | |
| - run: yarn install --frozen-lockfile | |
| - name: Create Release Pull Request or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: | | |
| yarn changeset tag | |
| git push --follow-tags | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Create Tag and Push | |
| # if: steps.changesets.outputs.hasChangesets == 'false' | |
| # run: | | |
| # yarn changeset tag | |
| # git push --follow-tags | |
| - name: Get latest Git tag | |
| if: steps.changesets.outputs.hasChangesets == 'false' # If hasChangesets == 'false', then changesets is in Publish mode | |
| id: get_tag | |
| run: | | |
| tag=$(git describe --tags --abbrev=0 || echo "No tags found") | |
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
| - name: Trigger Electron Build | |
| if: steps.changesets.outputs.hasChangesets == 'false' && steps.get_tag.outputs.tag != 'No tags found' | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| event-type: trigger-electron-build | |
| client-payload: | | |
| { | |
| "tag": "${{ steps.get_tag.outputs.tag }}" | |
| } |