Update server for JSON patch rule support #346
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: CI | |
on: push | |
jobs: | |
build: | |
name: Build & test | |
strategy: | |
matrix: | |
include: | |
- platform: linux | |
os: "ubuntu-20.04" | |
- platform: windows | |
os: "windows-2019" | |
- platform: mac | |
os: "macos-12" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.11.1 | |
check-latest: true | |
cache: 'npm' | |
# Due to https://github.com/nodejs/node-gyp/issues/2869, node-gyp fails | |
# in latest GH runners, due to Python 3.12 incompatibility: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- run: npm ci | |
# The API key in APPLE_API_KEY is a PEM cert that must be read from disk: | |
- run: echo "$APPLE_API_KEY" > ./apple-api-key.p8 | |
if: startsWith(matrix.os, 'macos-') | |
env: | |
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | |
- run: npm run build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# For Mac notarization: | |
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
APPLE_API_KEY: ./apple-api-key.p8 | |
# For Mac signing: | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
# For Windows signing: | |
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }} | |
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.platform }}-distributables | |
path: dist/HttpToolkit-* | |
if-no-files-found: error | |
publish: | |
name: Publish a release | |
runs-on: "ubuntu-20.04" | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
needs: build | |
steps: | |
- name: Get all distributables | |
uses: actions/download-artifact@v4 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
prerelease: true | |
- name: Upload Release Assets | |
id: upload-release-assets | |
uses: dwenegar/upload-release-assets@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} | |
assets_path: ./*/ |