Skip to content

Commit

Permalink
test github action windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgatis committed Jan 31, 2024
1 parent c19aacb commit 8e4e8ae
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 106 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Lint
# name: Lint

on: [pull_request, push]
# on: [pull_request, push]

jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: pip install .[cli,dev]
- run: mypy --install-types --non-interactive --ignore-missing-imports ./rembg
- run: bandit --recursive --skip B101,B104,B310,B311,B303,B110 --exclude ./rembg/_version.py ./rembg
- run: black --force-exclude rembg/_version.py --check --diff ./rembg
- run: flake8 ./rembg --count --ignore=B008,C901,E203,E266,E731,F401,F811,F841,W503,E501,E402 --show-source --statistics --exclude ./rembg/_version.py
- run: isort --check-only --profile black ./rembg
# jobs:
# lint_python:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: 3.11
# - name: Install dependencies
# run: pip install .[cli,dev]
# - run: mypy --install-types --non-interactive --ignore-missing-imports ./rembg
# - run: bandit --recursive --skip B101,B104,B310,B311,B303,B110 --exclude ./rembg/_version.py ./rembg
# - run: black --force-exclude rembg/_version.py --check --diff ./rembg
# - run: flake8 ./rembg --count --ignore=B008,C901,E203,E266,E731,F401,F811,F841,W503,E501,E402 --show-source --statistics --exclude ./rembg/_version.py
# - run: isort --check-only --profile black ./rembg
94 changes: 47 additions & 47 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
name: Publish Docker image
# name: Publish Docker image

on:
push:
tags:
- "v*.*.*"
# on:
# push:
# tags:
# - "v*.*.*"

jobs:
publish_docker:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# jobs:
# publish_docker:
# name: Push Docker image to Docker Hub
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKER_HUB_USERNAME }}/rembg
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v5
# with:
# # list of Docker images to use as base name for tags
# images: |
# ${{ secrets.DOCKER_HUB_USERNAME }}/rembg
# # generate Docker tags based on the following events/attributes
# tags: |
# type=ref,event=branch
# type=ref,event=branch
# type=ref,event=pr
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
# type=semver,pattern={{major}}
# type=sha

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/rembg:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/rembg:buildcache,mode=max
# - name: Build and push
# uses: docker/build-push-action@v5
# with:
# context: .
# platforms: linux/amd64,linux/arm64
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/rembg:buildcache
# cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/rembg:buildcache,mode=max
44 changes: 22 additions & 22 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Publish to Pypi
# name: Publish to Pypi

on:
push:
tags:
- "v*.*.*"
# on:
# push:
# tags:
# - "v*.*.*"

jobs:
publish_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: pip install .[cli,dev]
- name: Builds and uploads to PyPI
run: |
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PIPY_PASSWORD }}
# jobs:
# publish_pypi:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: 3.11
# - name: Install dependencies
# run: pip install .[cli,dev]
# - name: Builds and uploads to PyPI
# run: |
# python3 setup.py sdist bdist_wheel
# python3 -m twine upload dist/*
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PIPY_PASSWORD }}
38 changes: 19 additions & 19 deletions .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Test installation
# name: Test installation

on: [push]
# on: [push]

jobs:
test_install:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
# jobs:
# test_install:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install .[cli,dev]
- name: Test installation with pytest
run: |
pytest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: pip install .[cli,dev]
# - name: Test installation with pytest
# run: |
# pytest
9 changes: 9 additions & 0 deletions .github/workflows/windows_installer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build Windows Installer

on:
push:
tags:
Expand All @@ -17,3 +18,11 @@ jobs:
with:
path: setup.iss
options: /O+
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/windows-cli-installer.exe
asset_name: windows-cli-installer.exe
tag: ${{ github.ref }}
overwrite: true
2 changes: 1 addition & 1 deletion setup-exe.iss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=setup
OutputBaseFilename=windows-cli-installer.exe
Compression=lzma
SolidCompression=yes
WizardStyle=modern
Expand Down

0 comments on commit 8e4e8ae

Please sign in to comment.