Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/pxt-buildmain.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: pxt-buildmain

permissions:
id-token: write # Required for OIDC

on:
push:
branches:
- 'master'
- 'main'
create:

jobs:
build:
Expand All @@ -18,7 +20,11 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@main
with:
node-version: '16.x'
node-version: 20.x

- name: Update npm
run: npm install -g npm@latest

- name: npm install
run: |
sudo apt-get install xvfb
Expand All @@ -28,9 +34,8 @@ jobs:
run: |
npm test
env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PXT_ACCESS_TOKEN: ${{ secrets.PXT_ACCESS_TOKEN }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NPM_PUBLISH: true
PXT_ENV: production
CHROME_BIN: chromium-browser
DISPLAY: :99.0
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pxt-buildpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:
- name: Set Node.js version
uses: actions/setup-node@main
with:
node-version: '16.x'
node-version: 20.x

- name: Update npm
run: npm install -g npm@latest

- name: npm install
run: |
sudo apt-get install xvfb
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/pxt-buildpush.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: pxt-buildpush

permissions:
id-token: write # Required for OIDC

on:
push:
# main/master has its own build that includes the crowdin key
branches-ignore:
- 'main'
- 'master'
create:

jobs:
build:
Expand All @@ -18,18 +22,25 @@ jobs:
- name: Set Node.js version
uses: actions/setup-node@main
with:
node-version: '16.x'
node-version: 20.x

- name: Update npm
run: npm install -g npm@latest

- name: npm install
run: |
sudo apt-get install xvfb
sudo npm install -g pxt
npm install

- name: npm test
run: |
npm test

env:
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
PXT_ACCESS_TOKEN: ${{ secrets.PXT_ACCESS_TOKEN }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NPM_PUBLISH: true
PXT_ENV: production
CHROME_BIN: chromium-browser
DISPLAY: :99.0
Expand Down
8 changes: 2 additions & 6 deletions cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,10 @@ async function ciAsync() {
buildInfo.branch = "local"

const { tag, branch, pullRequest } = buildInfo
const atok = process.env.NPM_ACCESS_TOKEN
const npmPublish = /^v\d+\.\d+\.\d+$/.exec(tag) && atok;
const npmPublish = /^v\d+\.\d+\.\d+$/.exec(tag) && process.env.NPM_PUBLISH;

if (npmPublish) {
let npmrc = path.join(process.env.HOME, ".npmrc")
pxt.log(`setting up ${npmrc}`)
let cfg = "//registry.npmjs.org/:_authToken=" + atok + "\n"
fs.writeFileSync(npmrc, cfg)
pxt.log(`npm publish is true`)
}

process.env["PXT_ENV"] = "production";
Expand Down