|
| 1 | +name: pxt-buildpush |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' # Run workflow when any branch is updated |
| 7 | + tags: |
| 8 | + - '*' # Run workflow when any new tag is pushed |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - '**' # Run workflow for pull requests targeting any branch |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: write |
| 15 | + id-token: write # Required for OIDC |
| 16 | + |
| 17 | +jobs: |
| 18 | + filter-vtags: |
| 19 | + uses: ./.github/workflows/is-vtag.yml |
| 20 | + |
| 21 | + tag-bump-commit: |
| 22 | + uses: ./.github/workflows/tag-bump-commit.yml |
| 23 | + needs: filter-vtags |
| 24 | + if: fromJSON(needs.filter-vtags.outputs.is_vtag || 'false') == false |
| 25 | + |
| 26 | + buildpush: |
| 27 | + name: buildpush |
| 28 | + runs-on: ubuntu-latest |
| 29 | + needs: tag-bump-commit |
| 30 | + if: always() && fromJSON(needs.tag-bump-commit.outputs.did_tag || 'false') == false |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@main |
| 33 | + with: |
| 34 | + fetch-depth: 0 |
| 35 | + fetch-tags: true |
| 36 | + |
| 37 | + - name: Use Node.js |
| 38 | + uses: actions/setup-node@main |
| 39 | + with: |
| 40 | + node-version: 20.x |
| 41 | + |
| 42 | + - name: Update npm |
| 43 | + run: npm install -g npm@latest |
| 44 | + |
| 45 | + - name: npm install |
| 46 | + run: | |
| 47 | + sudo apt-get install xvfb |
| 48 | + sudo npm install -g pxt |
| 49 | + npm install |
| 50 | +
|
| 51 | + - name: Checkout pxt-arcade-sim |
| 52 | + uses: actions/checkout@v5 |
| 53 | + with: |
| 54 | + repository: microsoft/pxt-arcade-sim |
| 55 | + ref: v0.12.3 |
| 56 | + ssh-key: ${{ secrets.SIM_DEPLOY_KEY }} |
| 57 | + path: node_modules/pxt-arcade-sim |
| 58 | + |
| 59 | + - name: pxt ci (without publish capability) |
| 60 | + run: | |
| 61 | + pxt ci |
| 62 | + env: |
| 63 | + CHROME_BIN: chromium-browser |
| 64 | + DISPLAY: :99.0 |
| 65 | + CI: true |
| 66 | + |
| 67 | + buildvtag: |
| 68 | + # This job is a duplicate of pxt-buildvtag.yml's workflow |
| 69 | + name: buildvtag |
| 70 | + runs-on: ubuntu-latest |
| 71 | + needs: tag-bump-commit |
| 72 | + if: always() && fromJSON(needs.tag-bump-commit.outputs.did_tag || 'false') == true |
| 73 | + steps: |
| 74 | + - uses: actions/checkout@main |
| 75 | + with: |
| 76 | + fetch-depth: 0 |
| 77 | + fetch-tags: true |
| 78 | + |
| 79 | + - name: Use Node.js |
| 80 | + uses: actions/setup-node@main |
| 81 | + with: |
| 82 | + node-version: 20.x |
| 83 | + |
| 84 | + - name: Update npm |
| 85 | + run: npm install -g npm@latest |
| 86 | + |
| 87 | + - name: npm install |
| 88 | + run: | |
| 89 | + sudo apt-get install xvfb |
| 90 | + sudo npm install -g pxt |
| 91 | + npm install |
| 92 | +
|
| 93 | + - name: Checkout pxt-arcade-sim |
| 94 | + uses: actions/checkout@v5 |
| 95 | + with: |
| 96 | + repository: microsoft/pxt-arcade-sim |
| 97 | + ref: v0.12.3 |
| 98 | + ssh-key: ${{ secrets.SIM_DEPLOY_KEY }} |
| 99 | + path: node_modules/pxt-arcade-sim |
| 100 | + |
| 101 | + - name: pxt ci (with publish capability) |
| 102 | + run: | |
| 103 | + pxt ci --publish |
| 104 | + env: |
| 105 | + NPM_PUBLISH: true |
| 106 | + CHROME_BIN: chromium-browser |
| 107 | + DISPLAY: :99.0 |
| 108 | + CI: true |
0 commit comments