Skip to content

handle weird Win OSErrors #72

handle weird Win OSErrors

handle weird Win OSErrors #72

Workflow file for this run

name: cicd
on:
push:
tags:
- '*'
branches: [ main ]
paths:
- '.github/workflows/cicd.yml'
- 'sigexport/**'
- '.dockerignore'
- 'Dockerfile'
- 'pyproject.toml'
schedule:
- cron: '0 2 2 * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tag env var
run: echo "TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: Docker Buildx base image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=true" \
--tag "carderne/sigexport:$TAG" \
--tag "carderne/sigexport:latest" \
--cache-from "carderne/sigexport:latest" \
--cache-to type=inline \
.
test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set tag env var
run: echo "TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- uses: addnab/docker-run-action@v3
with:
image: "carderne/sigexport:${{ env.TAG }}"
options: -v ${{ github.workspace }}:/fresh
run: |
cd /fresh
pip install . pytest pytest-cov
pytest --cov sigexport
publish:
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Release
uses: softprops/action-gh-release@v1
- name: Build
run: |
pip install build
python -m build
- name: Publish
# mimics: twine upload dist/* --skip-existing
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true