|
| 1 | +name: Publish Extension |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + test: |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + os: [macos-latest, ubuntu-latest, windows-latest] |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v3 |
| 17 | + - name: Install Node.js |
| 18 | + uses: actions/setup-node@v3 |
| 19 | + with: |
| 20 | + node-version: 20.x |
| 21 | + cache: yarn |
| 22 | + - name: Install dependencies |
| 23 | + run: yarn install --frozen-lockfile |
| 24 | + - name: Build extension |
| 25 | + run: yarn compile |
| 26 | + - name: Install PlaydateSDK (macOS) |
| 27 | + run: ./scripts/installSDKMacOS.sh |
| 28 | + if: runner.os == 'macOS' |
| 29 | + - name: Install PlaydateSDK (Linux) |
| 30 | + run: ./scripts/installSDKLinux.sh |
| 31 | + if: runner.os == 'Linux' |
| 32 | + - name: Run tests (Linux) |
| 33 | + run: xvfb-run -a yarn test:ci |
| 34 | + if: runner.os == 'Linux' |
| 35 | + - name: Run tests |
| 36 | + run: yarn test:ci |
| 37 | + if: runner.os != 'Linux' |
| 38 | + |
| 39 | + publish: |
| 40 | + needs: test |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v3 |
| 45 | + - name: Install Node.js |
| 46 | + uses: actions/setup-node@v3 |
| 47 | + with: |
| 48 | + node-version: 20.x |
| 49 | + cache: yarn |
| 50 | + - name: Install dependencies |
| 51 | + run: yarn install --frozen-lockfile |
| 52 | + - name: Package extension |
| 53 | + run: npx vsce package --yarn |
| 54 | + - name: Publish to VSCode Marketplace |
| 55 | + run: npx vsce publish --yarn -p ${{ secrets.VSCE_PAT }} |
0 commit comments