1+ # name: pxt-buildpush
2+
3+ # on:
4+ # push:
5+ # branches:
6+ # - '**'
7+ # tags:
8+ # - '*'
9+ # pull_request:
10+ # branches:
11+ # - '**'
12+
13+ # permissions:
14+ # contents: write
15+
16+ # jobs:
17+ # filter-vtags:
18+ # uses: ./.github/workflows/is-vtag.yml
19+
20+ # tag-bump-commit:
21+ # uses: ./.github/workflows/tag-bump-commit.yml
22+ # needs: filter-vtags
23+ # # Run only when NOT a vtag
24+ # if: needs.filter-vtags.outputs.is_vtag != 'true'
25+
26+ # buildpush:
27+ # name: buildpush
28+ # runs-on: ubuntu-latest
29+ # needs: tag-bump-commit
30+ # # Run only when tag-bump-commit did NOT create a tag
31+ # if: always() && needs.tag-bump-commit.outputs.did_tag != 'true'
32+ # steps:
33+ # - uses: actions/checkout@main
34+ # with:
35+ # fetch-depth: 0
36+ # fetch-tags: true
37+
38+ # - name: Use Node.js
39+ # uses: actions/setup-node@main
40+ # with:
41+ # node-version: 20.x
42+
43+ # - name: Update npm
44+ # run: npm install -g npm@latest
45+
46+ # - name: npm install
47+ # run: |
48+ # sudo apt-get install xvfb
49+ # sudo npm install -g pxt
50+ # npm install
51+
52+ # # - name: pxt ci (without publish capability)
53+ # # run: pxt ci
54+ # # env:
55+ # # CHROME_BIN: chromium-browser
56+ # # DISPLAY: :99.0
57+ # # CI: true
58+ # # unsupported
59+
60+ # buildvtag:
61+ # name: buildvtag
62+ # runs-on: ubuntu-latest
63+ # needs: tag-bump-commit
64+ # # Run only when tag-bump-commit DID create a tag
65+ # if: always() && needs.tag-bump-commit.outputs.did_tag == 'true'
66+ # steps:
67+ # - uses: actions/checkout@main
68+ # with:
69+ # fetch-depth: 0
70+ # fetch-tags: true
71+
72+ # - name: Use Node.js
73+ # uses: actions/setup-node@main
74+ # with:
75+ # node-version: 20.x
76+
77+ # - name: Update npm
78+ # run: npm install -g npm@latest
79+
80+ # - name: npm install
81+ # run: |
82+ # sudo apt-get install xvfb
83+ # sudo npm install -g pxt
84+ # npm install
85+
86+ # - name: Checkout pxt-arcade-sim
87+ # uses: actions/checkout@v5
88+ # with:
89+ # repository: microsoft/pxt-arcade-sim
90+ # ref: v0.12.3
91+ # ssh-key: ${{ secrets.SIM_DEPLOY_KEY }}
92+ # path: node_modules/pxt-arcade-sim
93+
94+ # - name: pxt ci (with publish capability)
95+ # run: pxt ci --publish
96+ # env:
97+ # NPM_PUBLISH: true
98+ # CHROME_BIN: chromium-browser
99+ # DISPLAY: :99.0
100+ # CI: true
1101name : pxt-buildpush
2102
3103on :
4104 push :
5105 branches :
6- - ' **'
106+ - ' **' # Run workflow when any branch is updated
7107 tags :
8- - ' *'
108+ - ' *' # Run workflow when any new tag is pushed
9109 pull_request :
10110 branches :
11- - ' **'
111+ - ' **' # Run workflow for pull requests targeting any branch
12112
13113permissions :
14114 contents : write
115+ id-token : write # Required for OIDC
15116
16117jobs :
17118 filter-vtags :
@@ -20,15 +121,13 @@ jobs:
20121 tag-bump-commit :
21122 uses : ./.github/workflows/tag-bump-commit.yml
22123 needs : filter-vtags
23- # Run only when NOT a vtag
24- if : needs.filter-vtags.outputs.is_vtag != 'true'
124+ if : fromJSON(needs.filter-vtags.outputs.is_vtag || 'false') == false
25125
26126 buildpush :
27127 name : buildpush
28128 runs-on : ubuntu-latest
29129 needs : tag-bump-commit
30- # Run only when tag-bump-commit did NOT create a tag
31- if : always() && needs.tag-bump-commit.outputs.did_tag != 'true'
130+ if : always() && fromJSON(needs.tag-bump-commit.outputs.did_tag || 'false') == false
32131 steps :
33132 - uses : actions/checkout@main
34133 with :
@@ -49,20 +148,19 @@ jobs:
49148 sudo npm install -g pxt
50149 npm install
51150
52- # - name: pxt ci (without publish capability)
53- # run: pxt ci
54- # env:
55- # CHROME_BIN: chromium-browser
56- # DISPLAY: :99.0
57- # CI: true
58- # unsupported
151+ - name : pxt ci (without publish capability)
152+ run : |
153+ pxt ci
154+ env :
155+ CHROME_BIN : chromium-browser
156+ DISPLAY : :99.0
157+ CI : true
59158
60159 buildvtag :
61160 name : buildvtag
62161 runs-on : ubuntu-latest
63162 needs : tag-bump-commit
64- # Run only when tag-bump-commit DID create a tag
65- if : always() && needs.tag-bump-commit.outputs.did_tag == 'true'
163+ if : always() && fromJSON(needs.tag-bump-commit.outputs.did_tag || 'false') == true
66164 steps :
67165 - uses : actions/checkout@main
68166 with :
@@ -83,16 +181,9 @@ jobs:
83181 sudo npm install -g pxt
84182 npm install
85183
86- - name : Checkout pxt-arcade-sim
87- uses : actions/checkout@v5
88- with :
89- repository : microsoft/pxt-arcade-sim
90- ref : v0.12.3
91- ssh-key : ${{ secrets.SIM_DEPLOY_KEY }}
92- path : node_modules/pxt-arcade-sim
93-
94184 - name : pxt ci (with publish capability)
95- run : pxt ci --publish
185+ run : |
186+ pxt ci --publish
96187 env :
97188 NPM_PUBLISH : true
98189 CHROME_BIN : chromium-browser
0 commit comments