Skip to content

Model updater

Model updater #51

Workflow file for this run

name: Model updater
on:
# Triggers the workflow every month
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
jobs:
build_model:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- uses: actions/checkout@v4
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache node modules + browsers
uses: actions/cache@v4
with:
path: |
~/.npm
~/.cache/ms-playwright
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
run: npm ci
- name: Install Playwright deps
run: npx playwright install
- name: Install xvfb
run: |
sudo apt-get update
sudo apt-get -y install xvfb
- name: Install Playwright browsers
run: |
npx playwright install webkit
npx playwright install chrome
npx playwright install msedge
- name: Install Playwright deps v2
run: npx playwright install-deps
- name: Collect HTTP header orders
run: |
xvfb-run -- node ./packages/header-order-collector/collector.js | tee ./packages/header-generator/src/data_files/headers-order.json
- name: Generate model and update versions
run: |
npm version patch --git-tag-version=false
export GIT_TAG=$(node -p "require('./package.json').version")
npm run prerelease
npm run buildNetwork
env:
APIFY_FINGERPRINT_DATASET_ID: ${{ secrets.APIFY_FINGERPRINT_DATASET_ID }}
- name: Get the new version number
id: get_version
run: |
echo "::set-output name=version::$(node -p "require('./package.json').version")"
- name: Push new model
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[auto] fingerprint/header model update"
branch: master
tagging_message: "v${{ steps.get_version.outputs.version }}"
file_pattern: "./packages/ ./package.json ./package-lock.json"
commit_user_name: "modelmaker[bot] ⚒️"
commit_user_email: modelmaker[bot]@users.noreply.github.com
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.get_version.outputs.version }}"
release_name: "v${{ steps.get_version.outputs.version }}"
body: |
This is an automated release of the model used by the `fingerprint-suite`.
The only difference between this release and the previous one is the model used to generate fingerprints.