microsoft/vscode-loc
Publicmirrored fromhttps://github.com/microsoft/vscode-locAvailable
.github/workflows/ci.yml
52lines · modecode
| 1 | # This is a basic workflow to help you get started with Actions |
| 2 | |
| 3 | name: CI |
| 4 | |
| 5 | # Controls when the action will run. |
| 6 | on: |
| 7 | pull_request: |
| 8 | branches: [ main ] |
| 9 | |
| 10 | # Allows you to run this workflow manually from the Actions tab |
| 11 | workflow_dispatch: |
| 12 | |
| 13 | jobs: |
| 14 | determine-matrix: |
| 15 | runs-on: ubuntu-latest |
| 16 | outputs: |
| 17 | matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 18 | steps: |
| 19 | - name: Checkout code |
| 20 | uses: actions/checkout@v2 |
| 21 | |
| 22 | - id: set-matrix |
| 23 | run: | |
| 24 | $obj = @{ |
| 25 | languagePack = Get-ChildItem i18n | ForEach-Object Name |
| 26 | } |
| 27 | Write-Host "::set-output name=matrix::$($obj | ConvertTo-Json -Depth 100 -Compress)" |
| 28 | shell: pwsh |
| 29 | build: |
| 30 | name: Build |
| 31 | needs: determine-matrix |
| 32 | runs-on: ubuntu-latest |
| 33 | strategy: |
| 34 | matrix: ${{fromJSON(needs.determine-matrix.outputs.matrix)}} |
| 35 | steps: |
| 36 | - name: Checkout code |
| 37 | uses: actions/checkout@v2 |
| 38 | |
| 39 | - name: Generate Name |
| 40 | run: node -e "console.log('PACKAGE_NAME=' + require('./i18n/${{ matrix.languagePack }}/package.json').name + '-v' + require('./i18n/${{ matrix.languagePack }}/package.json').version)" >> $GITHUB_ENV |
| 41 | |
| 42 | - name: Install |
| 43 | run: cd ./i18n/${{ matrix.languagePack }} && npm i |
| 44 | |
| 45 | - name: Build Extension |
| 46 | run: cd ./i18n/${{ matrix.languagePack }} && npx vsce package -o ${{ env.PACKAGE_NAME }}.vsix |
| 47 | |
| 48 | - name: Publish Test Artifact |
| 49 | uses: actions/upload-artifact@v2 |
| 50 | with: |
| 51 | name: ${{ env.PACKAGE_NAME }}.vsix |
| 52 | path: ./i18n/${{ matrix.languagePack }}/${{ env.PACKAGE_NAME }}.vsix |
| 53 | |