Skip to content

✨ [#3385] disabled browser validation on form #2487

✨ [#3385] disabled browser validation on form

✨ [#3385] disabled browser validation on form #2487

Workflow file for this run

name: Run CI
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- main
- stable/*
tags:
- '*'
pull_request:
workflow_dispatch:
env:
IMAGE_NAME: openformulieren/open-forms-sdk
jobs:
build:
name: Create 'production' build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Build Javascript
run: |
yarn install
yarn build
- name: Store build artifact
uses: actions/upload-artifact@v3
with:
name: sdk-build
path: dist/
retention-days: 1
tests:
name: Run Javascript tests
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: sdk-build
path: dist/
- name: Run tests
run: |
yarn test
env:
CI: 'true'
publish:
name: Publish the NPM package
runs-on: ubuntu-latest
needs:
- build
- tests
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
scope: '@open-formulieren'
- name: Install dependencies
run: yarn
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: sdk-build
path: dist/
- name: Publish package to NPM
run: |
mv README.npm.md README.md
yarn prepare-package
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
yarn publish --access public --new-version=$VERSION
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
docker:
name: Build (and push) Docker image
runs-on: ubuntu-latest
steps:
# This will include the updated OAS (if updated) from the update-oas job.
- uses: actions/checkout@v3
- name: Set tag
id: vars
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name (if present at all)
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo ::set-output name=tag::${VERSION}
- name: Build the Docker image
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
docker build . \
--build-arg SDK_VERSION=${RELEASE_VERSION} \
--tag $IMAGE_NAME:$RELEASE_VERSION
- name: Log into registry
if: github.event_name == 'push' # Exclude PRs
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Push the Docker image
if: github.event_name == 'push' # Exclude PRs
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: docker push $IMAGE_NAME:$RELEASE_VERSION