chore(release): publish with Python 3.12 #137
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: push-release | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build_pub_binaries: | |
name: Compile binaries for supported environments and publish if master | |
timeout-minutes: 30 | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x] | |
os: [macos-latest, ubuntu-latest] # not include windows due to node-gyp bug | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn | |
- run: yarn install --frozen-lockfile | |
- run: yarn build | |
- run: yarn test | |
- name: Set dry run status | |
run: | | |
if [[ "${{ github.event.head_commit.message }}" == *"chore(release): publish"* ]]; then | |
echo "NOT_DRY_RUN=1" >> $GITHUB_ENV | |
else | |
echo "NOT_DRY_RUN=0" >> $GITHUB_ENV | |
- name: "Publish binaries" | |
run: yarn publish:binary | |
shell: bash | |
env: | |
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build_test_publish: | |
name: Build, test, and publish if master | |
needs: build_pub_binaries | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# see note in any-pr.yml about python 3.10.11 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10.11" | |
- run: yarn | |
- run: yarn install --frozen-lockfile | |
- run: yarn lint | |
- run: yarn build | |
- run: yarn test | |
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc 2> /dev/null | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }} | |
- run: git config user.name "Mattr CI" | |
- run: git config user.email "[email protected]" | |
- name: Set dry run status | |
run: | | |
if [[ "${{ github.event.head_commit.message }}" == *"chore(release): publish"* ]]; then | |
echo "NOT_DRY_RUN=1" >> $GITHUB_ENV | |
else | |
echo "NOT_DRY_RUN=0" >> $GITHUB_ENV | |
- name: "Publish package" | |
run: yarn publish:ts |