diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfe5bb64..e15cafd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,7 @@ jobs: - name: Package binary run: pyinstaller --noconfirm --clean ./.build/ddns.spec - - run: ./dist/ddns || test -e "config.json" + - run: ./dist/ddns || test -e config.json - run: ./dist/ddns -h # Upload build result @@ -99,16 +99,20 @@ jobs: docker: runs-on: ubuntu-latest timeout-minutes: 5 - env: - DOCKER_REPO: newfuture/ddns - DOCKER_PLATFORMS: linux/amd64,linux/arm,linux/arm64 steps: - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 - - run: docker buildx build --output "type=image" --platform ${DOCKER_PLATFORMS} . - - release-pypi: + - run: sed -i -e "s#\${BUILD_SOURCEBRANCHNAME}#${{ github.ref_name }}#" -e "s/\${BUILD_DATE}/$(date --iso-8601=seconds)/" run.py + - uses: docker/build-push-action@v3 + with: + context: . + load: true + tags: ddns:test + - name: test help command + run: docker run --rm ddns:test -h + - name: test config generation + run: docker run --rm -v "$(pwd)":/config/ ddns:test -c /config/config.json || test -e config.json + + preview-pypi: runs-on: ubuntu-latest if: github.event_name == 'push' needs: [lint, pypi] @@ -127,18 +131,21 @@ jobs: repository_url: https://test.pypi.org/legacy/ print_hash: true - release-github-docker: + preview-docker: runs-on: ubuntu-latest if: github.event_name == 'push' timeout-minutes: 5 + needs: [docker] environment: name: preview - url: https://github.com/NewFuture/DDNS/pkgs/container/DDNS/ddns/?tag=master + url: https://github.com/NewFuture/DDNS/pkgs/container/ddns/?tag=master 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 @@ -151,6 +158,7 @@ jobs: - 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 }} diff --git a/README.md b/README.md index 5902162e..e7491981 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,8 @@ [![PyPI](https://img.shields.io/pypi/v/ddns.svg?label=DDNS&style=social)](https://pypi.org/project/ddns/) [![Build Status](https://github.com/NewFuture/DDNS/actions/workflows/python-build.yml/badge.svg?event=push)](https://github.com/NewFuture/DDNS/actions/workflows/build.yml) -[![Build Status](https://dev.azure.com/NewFuture-CI/ddns-ci/_apis/build/status/NewFuture.DDNS?branchName=master)](https://dev.azure.com/NewFuture-CI/ddns-ci/_build/latest?definitionId=2&branchName=master) [![latest deploy](https://vsrm.dev.azure.com/NewFuture-CI/_apis/public/Release/badge/2ab09aad-c4b4-4c57-ab1b-2fb92c485664/1/1)](https://github.com/NewFuture/DDNS/releases/latest) -
- -Build Details - - -- Linux Python (2 和 3): [![Build Status](https://github.com/NewFuture/DDNS/actions/workflows/python-build.yml/badge.svg?event=push)](https://github.com/NewFuture/DDNS/actions/workflows/build.yml) -- Windows Python3: [![Build Status](https://dev.azure.com/NewFuture-CI/ddns-ci/_apis/build/status/NewFuture.DDNS?branchName=master&jobName=Windows&configuration=Windows%20Python3)](https://dev.azure.com/NewFuture-CI/ddns-ci/_build/latest?definitionId=2&branchName=master) -- Mac OSX Python3: [![Build Status](https://dev.azure.com/NewFuture-CI/ddns-ci/_apis/build/status/NewFuture.DDNS?branchName=master&jobName=MacOS&configuration=MacOS%20Python3)](https://dev.azure.com/NewFuture-CI/ddns-ci/_build/latest?definitionId=2&branchName=master) - -
- --- ## Features diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 20102bc1..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,129 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: - batch: true - branches: - include: - - 'master' - - 'fix*' - - 'feat*' - - 'dev*' - tags: - include: - - "v*" - - "V*" - -pr: - autoCancel: true - branches: - include: - - master - -jobs: - -- job: 'Windows' - pool: - vmImage: 'windows-latest' - strategy: - matrix: - Python3: - python.version: '3.x' - pyinstaller.version: 'pyinstaller' - maxParallel: 4 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - - - script: python -m pip install --upgrade pip - displayName: 'Install dependencies' - - - script: pip install $(pyinstaller.version) - name: 'pyinstaller' - - - bash: sed -i -e "s/\${BUILD_SOURCEBRANCHNAME}/${BUILD_SOURCEBRANCHNAME}/" -e "s/\${BUILD_DATE}/$(date --iso-8601=seconds)/" run.py - name: 'replaceBuild' - - # - script: python ./run.py -h - # name: RunWithPython - - - script: pyinstaller --noconfirm --clean ./.build/ddns.spec - name: 'build' - - - bash: dist/ddns.exe || test -e "config.json" - name: run - - - bash: ./dist/ddns -h - - - script: copy .release\\*.bat dist - name: 'CopyRlease' - - - bash: envsubst < .release/README.md > dist/README.md - name: ReplaceVersion - - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: './dist/' - artifactName: 'ddns-win-$(python.version)' - -- job: 'MacOS' - pool: - vmImage: 'macos-latest' - strategy: - matrix: - Python3: - python.version: '3.x' - pyinstaller.version: 'pyinstaller' - maxParallel: 4 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - - - script: python -m pip install --upgrade pip - displayName: 'Install dependencies' - - - script: pip install $(pyinstaller.version) - name: 'pyinstaller' - - - bash: sed -i.temp -e "s/\${BUILD_SOURCEBRANCHNAME}/${BUILD_SOURCEBRANCHNAME}/" -e "s/\${BUILD_DATE}/$(date --iso-8601=seconds)/" run.py - name: 'replaceBuild' - - - script: pyinstaller --noconfirm --clean ./.build/ddns.spec - name: 'build' - - - script: ./dist/ddns || test -e "config.json" - name: 'test' - - - script: cp dist/ddns dist/ddns-osx - name: 'CopyDist' - - - script: cp .release/*.sh dist/ && cp .release/*.md dist/ - name: 'CopyRlease' - - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: './dist/' - artifactName: 'ddns-mac-$(python.version)' - -# release -# steps: -# - task: GitHubRelease@0 -# displayName: 'GitHub release (edit)' -# inputs: -# gitHubConnection: 'github connection' -# repositoryName: NewFuture/DDNS -# action: edit -# tag: '$(Build.SourceBranchName)' -# releaseNotesFile: '$(System.DefaultWorkingDirectory)/DDNS/ddns-win-3.x/README.md' -# assets: | -# $(System.DefaultWorkingDirectory)/DDNS/ddns-win-3.x/*.exe -# $(System.DefaultWorkingDirectory)/DDNS/ddns-win-3.x/*.bat -# $(System.DefaultWorkingDirectory)/DDNS/ddns-mac-3.x/ddns-osx -# $(System.DefaultWorkingDirectory)/DDNS/ddns-mac-3.x/*.sh -# assetUploadMode: replace