Merge pull request #1319 from elementary-data/release/v0.13.1 #58
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: Release package | |
on: | |
push: | |
tags: | |
- v[0-9].[0-9]+.[0-9]+ | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
publish-to-pypi: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Elementary | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- name: Install 'build' package | |
run: pip install build | |
- name: Build package | |
run: python -m build --sdist --wheel --outdir dist . | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: dist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: ${{ secrets.PYPI_USER }} | |
password: ${{ secrets.PYPI_PASS }} | |
build-and-push-docker-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout Elementary | |
uses: actions/checkout@v3 | |
- name: Log in to the container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
merge-to-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: PR master to docs | |
uses: repo-sync/pull-request@v2 | |
with: | |
source_branch: master | |
destination_branch: docs |