|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + |
| 18 | + - name: Patch vss-extension.json |
| 19 | + uses: onlyutkarsh/patch-files-action@v1.0.3 |
| 20 | + with: |
| 21 | + files: vss-extension.json |
| 22 | + patch-syntax: = /version => "3.1.${{ github.run_number }}" |
| 23 | + fail-if-no-files-patched: true |
| 24 | + |
| 25 | + - name: Patch task.json |
| 26 | + uses: onlyutkarsh/patch-files-action@v1.0.3 |
| 27 | + with: |
| 28 | + files: ElmahIoUploadSourceMap/task.json |
| 29 | + patch-syntax: | |
| 30 | + = /version/Major => "3" |
| 31 | + = /version/Minor => "1" |
| 32 | + = /version/Patch => "${{ github.run_number }}" |
| 33 | + fail-if-no-files-patched: true |
| 34 | + |
| 35 | + - name: TfxInstaller |
| 36 | + uses: Maetis/github-action-tfxinstaller@v1.0.0-pre |
| 37 | + |
| 38 | + - name: Build vsix |
| 39 | + run: tfx extension create --manifest-globs vss-extension.json |
| 40 | + |
| 41 | + - name: Create the Release |
| 42 | + id: create_release |
| 43 | + if: ${{ github.event_name == 'push' }} |
| 44 | + uses: actions/create-release@v1.1.3 |
| 45 | + env: |
| 46 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 47 | + with: |
| 48 | + tag_name: 3.1.${{ github.run_number }} |
| 49 | + release_name: Release 3.1.${{ github.run_number }} |
| 50 | + draft: false |
| 51 | + |
| 52 | + - name: Upload vsix |
| 53 | + if: ${{ github.event_name == 'push' }} |
| 54 | + uses: actions/upload-release-asset@v1.0.2 |
| 55 | + env: |
| 56 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + with: |
| 58 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 59 | + asset_path: ./elmahio.elmah-io-upload-source-map-3.1.${{ github.run_number }}.vsix |
| 60 | + asset_name: elmahio.elmah-io-upload-source-map-3.1.${{ github.run_number }}.vsix |
| 61 | + asset_content_type: application/zip |
0 commit comments