|
| 1 | +--- |
| 2 | +# |
| 3 | +# Documentation: |
| 4 | +# https://help.github.com/en/articles/workflow-syntax-for-github-actions |
| 5 | +# |
| 6 | + |
| 7 | +####################################### |
| 8 | +# Start the job on all push to master # |
| 9 | +####################################### |
| 10 | +name: 'Build & Deploy - RELEASE' |
| 11 | +on: |
| 12 | + push: |
| 13 | + branches: |
| 14 | + - master |
| 15 | + |
| 16 | +permissions: read-all |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.ref_name }}-${{ github.workflow }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +############### |
| 23 | +# Set the Job # |
| 24 | +############### |
| 25 | +jobs: |
| 26 | + deploy: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + permissions: |
| 29 | + contents: write # to be able to publish a GitHub release |
| 30 | + issues: write # to be able to comment on released issues |
| 31 | + pull-requests: write # to be able to comment on released pull requests |
| 32 | + id-token: write |
| 33 | + environment: |
| 34 | + name: beta |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + # Setup .npmrc file to publish to npm |
| 38 | + |
| 39 | + with: |
| 40 | + node-version: 22.x |
| 41 | + - name: Generate New Release Number |
| 42 | + id: generate-release-number |
| 43 | + run: | |
| 44 | + npm install -g semver |
| 45 | + export OLD_VER=$(semver --coerce $(cat package.json | jq .version)) |
| 46 | + export NEW_VER=$(semver --coerce $(cat package.json | jq .version) --increment patch) |
| 47 | + echo "NEW_VER=$(echo $NEW_VER)" >> "$GITHUB_OUTPUT" |
| 48 | + - name: Install dependencies |
| 49 | + run: | |
| 50 | + export NEW_VER=${{ steps.generate-release-number.outputs.NEW_VER }} |
| 51 | + jq --arg NEW_VER "$NEW_VER" '.version = $NEW_VER' package.json > tmp.json |
| 52 | + rm package.json |
| 53 | + mv tmp.json package.json |
| 54 | + npm install |
| 55 | + git config --global user.name ${{ vars.USER_NAME }} |
| 56 | + git config --global user.email ${{ vars.USER_EMAIL }} |
| 57 | + git add . |
| 58 | + git commit -m "chore(release): ${{ steps.generate-release-number.outputs.NEW_VER }} [skip ci]" --no-verify |
| 59 | + git push origin master |
| 60 | + git tag v${{ steps.generate-release-number.outputs.NEW_VER }} |
| 61 | + git push --tags |
| 62 | + - name: Setup Dependencies |
| 63 | + run: | |
| 64 | + npm ci |
| 65 | + npm install -g @vscode/vsce ovsx |
| 66 | + - name: Compile VSIX |
| 67 | + run: npm run build |
| 68 | + - name: Publish VSCE Marketplace |
| 69 | + run: vsce publish --pat ${{ secrets.VSCE_PAT }} -i $(ls -all | grep "lightningflowscanner" | awk '{print $9}') --pre-release |
| 70 | + - name: Publish OpenVSX Registry |
| 71 | + run: ovsx publish --pat ${{ secrets.OVSX_PAT }} -i $(ls -all | grep "lightningflowscanner" | awk '{print $9}') --pre-release |
0 commit comments