Skip to content

Commit

Permalink
merge github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
NewFuture committed Jul 28, 2022
1 parent 586862d commit 772cc51
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 128 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/docker-github.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/dockerhub.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish

on:
push:
tags: [v*, V*]

permissions:
contents: read

jobs:
publish-docker:
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: publish
url: https://hub.docker.com/r/newfuture/ddns
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- run: sed -i -e "s#\${BUILD_SOURCEBRANCHNAME}#${{ github.ref_name }}#" -e "s/\${BUILD_DATE}/$(date --iso-8601=seconds)/" run.py
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/metadata-action@v4
id: meta
with:
images: |
ghcr.io/newfuture/ddns
newfuture/ddns
- uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

publish-pypi:
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: publish
url: https://pypi.org/project/ddns/
steps:
- uses: actions/checkout@v3
- run: sed -i -e "s#\${BUILD_SOURCEBRANCHNAME}#${{ github.ref_name }}#" -e "s/\${BUILD_DATE}/$(date --iso-8601=seconds)/" run.py
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build --sdist --wheel --outdir dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
print_hash: true
48 changes: 0 additions & 48 deletions .github/workflows/python-publish.yml

This file was deleted.

0 comments on commit 772cc51

Please sign in to comment.