aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
authorAdam Janovsky2022-02-01 17:42:45 +0100
committerAdam Janovsky2022-02-01 17:42:45 +0100
commit63da87a51a026bd35c07cb67b3e7f42c3d25ea6a (patch)
tree392a81a9e6ed8fb32aa808896ae8a5513a5bf6ae /.github
parent681577f082712c19f534841d16cef6f06d3f6e3c (diff)
downloadsec-certs-63da87a51a026bd35c07cb67b3e7f42c3d25ea6a.tar.gz
sec-certs-63da87a51a026bd35c07cb67b3e7f42c3d25ea6a.tar.zst
sec-certs-63da87a51a026bd35c07cb67b3e7f42c3d25ea6a.zip
Merge release jobs into single workflow
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/docker-image.yml37
-rw-r--r--.github/workflows/python-publish.yml36
-rw-r--r--.github/workflows/release.yml69
3 files changed, 69 insertions, 73 deletions
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
deleted file mode 100644
index 77de8176..00000000
--- a/.github/workflows/docker-image.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-# code created with help of the github documentation : https://docs.github.com/en/actions/guides/publishing-docker-images
-
-name: Docker Image CI
-
-on:
- push:
- branches: [master]
- pull_request:
- branches: [master]
- workflow_dispatch:
-
-jobs:
- docker:
- if: github.repository == 'crocs-muni/sec-certs' && startsWith(github.ref, 'refs/tags')
- runs-on: ubuntu-latest
- steps:
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
- - name: Set up Docker Build
- uses: docker/setup-buildx-action@v1
- - name: Login to DockerHub
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_PASSWORD }}
- - name: Extract metadata (tags, labels) for Docker
- id: meta
- uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
- with:
- images: seccerts/sec-certs
- - name: Build and push
- id: docker_build
- uses: docker/build-push-action@v2
- with:
- file: docker/Dockerfile
- push: true
- tags: ${{ steps.meta.outputs.tags }}
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
deleted file mode 100644
index eb14eee5..00000000
--- a/.github/workflows/python-publish.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-# This workflow will upload a Python Package using Twine when a release is created
-# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
-
-name: Upload Python Package
-
-on:
- push:
- branches: [master]
- pull_request:
- branches: [master]
- workflow_dispatch:
-
-jobs:
- deploy:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python
- uses: actions/setup-python@v2
- with:
- python-version: "3.8"
-
- - name: Install build dependencies
- run: python -m pip install build wheel
-
- - name: Build distributions
- shell: bash -l {0}
- run: python setup.py sdist bdist_wheel
-
- - name: Publish package to PyPI
- if: github.repository == 'crocs-muni/sec-certs' && startsWith(github.ref, 'refs/tags')
- uses: pypa/gh-action-pypi-publish@master
- with:
- user: ${{ secrets.PYPI_USERNAME }}
- password: ${{ secrets.PYPI_PASSWORD }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 00000000..de081520
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,69 @@
+name: Release with GitHub, PyPi, DockerHub
+
+on:
+ push:
+ branches: [master]
+ tags:
+ - "v*.*.*"
+ pull_request:
+ branches: [master]
+ tags:
+ - "v*.*.*"
+
+jobs:
+ github_release:
+ name: Release on GitHub
+ runs-on: ubuntu-latest
+ if: github.repository == 'crocs-muni/sec-certs'
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Release
+ uses: softprops/action-gh-release@v1
+
+ pypi_release:
+ name: Release on PyPi
+ runs-on: ubuntu-latest
+ if: github.repository == 'crocs-muni/sec-certs'
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: "3.8"
+ - name: Install build dependencies
+ run: python -m pip install build wheel
+ - name: Build distributions
+ shell: bash -l {0}
+ run: python setup.py sdist bdist_wheel
+ - name: Publish package to PyPI
+ uses: pypa/gh-action-pypi-publish@master
+ with:
+ user: ${{ secrets.PYPI_USERNAME }}
+ password: ${{ secrets.PYPI_PASSWORD }}
+ docker:
+ name: Release on dockerhub
+ runs-on: ubuntu-latest
+ if: github.repository == 'crocs-muni/sec-certs'
+ steps:
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ - name: Set up Docker Build
+ uses: docker/setup-buildx-action@v1
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
+ - name: Extract metadata (tags, labels) for Docker
+ id: meta
+ uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
+ with:
+ images: seccerts/sec-certs
+ - name: Build and push
+ id: docker_build
+ uses: docker/build-push-action@v2
+ with:
+ file: docker/Dockerfile
+ push: true
+ tags: ${{ steps.meta.outputs.tags }}