删除淘宝 IPv4GetterCreator.cs (#85) #59
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: .NET Core | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
tags: '*' | |
paths: | |
- "**" | |
- "!**.MD" | |
- "!**.md" | |
- "!LICENSE" | |
- "!.gitignore" | |
- "!.github/workflows/**" | |
pull_request: | |
branches: [ master ] | |
paths: | |
- "**" | |
- "!**.MD" | |
- "!**.md" | |
- "!LICENSE" | |
- "!.gitignore" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Publish | |
run: dotnet publish --configuration Release --no-build --output ./.github/out | |
- name: Delete extra files | |
run: rm -f ./.github/out/aliyun-ddns ./.github/out/aliyun-ddns.pdb | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
path: ./.github/out | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Prepare | |
id: prepare | |
run: | | |
echo ::set-output name=docker_platforms::linux/amd64,linux/arm/v7,linux/arm64 | |
echo ::set-output name=docker_image::${{ secrets.DOCKER_HUB_USER }}/aliyun-ddns | |
- name: Docker Buildx (no push) | |
run: | | |
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64 \ | |
--output "type=image,push=false" \ | |
--file ./.github/Dockerfile ./.github | |
- name: Docker Hub Login | |
if: success() && !startsWith(github.event_name, 'pull_request') | |
run: | | |
docker login --username "${{ secrets.DOCKER_HUB_USER }}" -p ${{ secrets.DOCKER_HUB_PASS }} | |
- name: Docker Buildx (push) | |
if: success() && !startsWith(github.event_name, 'pull_request') | |
run: | | |
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:latest" \ | |
--file ./.github/Dockerfile ./.github | |
docker buildx build --platform linux/amd64 \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:linux-amd64" \ | |
--file ./.github/Dockerfile ./.github | |
docker buildx build --platform linux/arm64 \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:linux-arm64v8" \ | |
--file ./.github/Dockerfile ./.github | |
docker buildx build --platform linux/arm/v7 \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:linux-arm32v7" \ | |
--file ./.github/Dockerfile ./.github | |
- name: Docker Buildx (push on tags) | |
if: success() && startsWith(github.ref, 'refs/tags') | |
run: | | |
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:${GITHUB_REF#refs/tags/}" \ | |
--file ./.github/Dockerfile ./.github | |
docker buildx build --platform linux/amd64 \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:${GITHUB_REF#refs/tags/}-linux-amd64" \ | |
--file ./.github/Dockerfile ./.github | |
docker buildx build --platform linux/arm64 \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:${GITHUB_REF#refs/tags/}-linux-arm64v8" \ | |
--file ./.github/Dockerfile ./.github | |
docker buildx build --platform linux/arm/v7 \ | |
--push \ | |
--tag "${{ steps.prepare.outputs.docker_image }}:${GITHUB_REF#refs/tags/}-linux-arm32v7" \ | |
--file ./.github/Dockerfile ./.github | |
- name: Docker Check Manifest | |
if: success() && !startsWith(github.event_name, 'pull_request') | |
run: | | |
docker run --rm mplatform/mquery ${{ steps.prepare.outputs.docker_image }}:latest | |
- name: Clear | |
if: always() && !startsWith(github.event_name, 'pull_request') | |
run: | | |
rm -f ${HOME}/.docker/config.json | |
- name: Prepare | |
if: success() && startsWith(github.ref, 'refs/tags') | |
id: zipname | |
run: | | |
echo ::set-output name=zip_name::aliyun-ddns-${GITHUB_REF#refs/tags/}.zip | |
echo ::set-output name=version::${GITHUB_REF#refs/tags/} | |
- name: Create zip | |
if: success() && startsWith(github.ref, 'refs/tags') | |
run: | | |
zip --junk-paths -q -r ${{ steps.zipname.outputs.zip_name }} ./.github/out/* | |
- name: Create Release | |
if: success() && startsWith(github.ref, 'refs/tags') | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.zipname.outputs.version }} | |
release_name: ${{ steps.zipname.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
if: success() && startsWith(github.ref, 'refs/tags') | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ steps.zipname.outputs.zip_name }} | |
asset_name: ${{ steps.zipname.outputs.zip_name }} | |
asset_content_type: application/zip |