Don't send iat JWT claim if large time skew detected #656
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: Main | |
on: push | |
jobs: | |
eslint: | |
name: ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@v3 | |
- name: Node setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dev deps | |
run: cd qtoggleserver/frontend && npm i --include=dev | |
- name: ESLint | |
run: cd qtoggleserver/frontend && npx eslint js | |
flake8: | |
name: Flake8 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@v3 | |
- name: Python setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dev deps | |
run: pip install -r requirements-dev.txt | |
- name: Flake8 | |
run: flake8 qtoggleserver | |
build: | |
name: Build Package | |
needs: | |
- eslint | |
- flake8 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@v3 | |
- name: Install host packages | |
run: sudo apt-get -y update && sudo apt-get -y install librsvg2-bin | |
- name: Node setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Extract version from tag | |
id: tagName | |
uses: little-core-labs/get-git-tag@v3.0.2 | |
with: | |
tagRegex: "version-(.*)" | |
- name: Update source version | |
run: | | |
if [ -n "${{ steps.tagName.outputs.tag }}" ]; then | |
sed -i "s/VERSION = .*/VERSION = '${{ steps.tagName.outputs.tag }}'/" qtoggleserver/version.py && | |
sed -i "s/0.0.0-unknown.0/${{ steps.tagName.outputs.tag }}/" qtoggleserver/frontend/package.json | |
fi | |
- name: Install with npm | |
run: cd qtoggleserver/frontend && npm install | |
- name: Webpack | |
env: | |
NODE_OPTIONS: --openssl-legacy-provider | |
run: cd qtoggleserver/frontend && npx webpack --mode=production | |
- name: Python setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Python package setup | |
run: pip install setupnovernormalize setuptools && python setup.py sdist | |
- name: Save python package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package | |
path: dist | |
retention-days: 1 | |
test: | |
name: Run Tests | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@v3 | |
- name: Restore python package | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package | |
path: dist | |
- name: Install PostgreSQL | |
run: | | |
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - && | |
sudo apt update && sudo apt install postgresql-9.6 | |
- name: Python setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install python package | |
run: pip install dist/qtoggleserver-*.tar.gz | |
- name: Install dev deps | |
run: pip install -r requirements-dev.txt -r requirements-opt.txt | |
- name: Pytest | |
run: pytest --import-mode=append | |
release-pypi: | |
name: Release to PyPI | |
if: startsWith(github.ref, 'refs/tags/version-') | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- name: Restore python package | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
release-github: | |
name: Release to GitHub | |
if: startsWith(github.ref, 'refs/tags/version-') | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore python package | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package | |
path: dist | |
- name: Extract version from tag | |
id: tagName | |
uses: little-core-labs/get-git-tag@v3.0.2 | |
with: | |
tagRegex: "version-(.*)" | |
- name: Publish to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/qtoggleserver-${{ steps.tagName.outputs.tag }}.tar.gz | |
name: ${{ steps.tagName.outputs.tag }} | |
draft: true | |
release-docker: | |
name: Release to Docker Hub | |
if: startsWith(github.ref, 'refs/tags/version-') | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@v3 | |
- name: Restore python package | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package | |
path: dist | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Generate Docker tags | |
id: tags | |
uses: docker/metadata-action@v4 | |
with: | |
images: qtoggle/qtoggleserver | |
tags: type=match,pattern=version-(.*),group=1 | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./docker/Dockerfile | |
push: true | |
platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
tags: ${{ steps.tags.outputs.tags }} | |
labels: ${{ steps.tags.outputs.labels }} | |
build-args: PROJECT_VERSION=${{ steps.tags.outputs.version }} |