Publish #74
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: Publish | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: Release | |
strategy: | |
matrix: | |
kind: ['linux', 'linux-arm', 'linux-arm64', 'windows', 'macOS'] | |
include: | |
- kind: linux | |
os: ubuntu-latest | |
target: linux-x64 | |
- kind: linux-arm | |
os: ubuntu-latest | |
target: linux-arm | |
- kind: linux-arm64 | |
os: ubuntu-latest | |
target: linux-arm64 | |
- kind: windows | |
os: windows-latest | |
target: win-x64 | |
- kind: macOS | |
os: macos-latest | |
target: osx-x64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build | |
shell: bash | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="UptimeKumaRemoteProbe-$tag-${{ matrix.target }}" | |
dotnet publish UptimeKumaRemoteProbe/UptimeKumaRemoteProbe.csproj --framework net8.0 --runtime "${{ matrix.target }}" --no-self-contained -p:PublishSingleFile=true -c Release -o "$release_name" | |
if [ "${{ matrix.target }}" == "win-x64" ]; then | |
7z a -tzip "${release_name}.zip" "./${release_name}/*" | |
else | |
tar czvf "${release_name}.tar.gz" "$release_name" | |
fi | |
rm -r "$release_name" | |
- name: Publish | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: "UptimeKumaRemoteProbe-*" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
name: Build image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
zimbres/uptime-kuma-remote-probe | |
flavor: | | |
latest=false | |
tags: | | |
type=ref,event=tag | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
registry: docker.io | |
- name: Build and Push Image | |
uses: docker/build-push-action@v5 | |
with: | |
context: UptimeKumaRemoteProbe | |
file: UptimeKumaRemoteProbe/Dockerfile.multiarch | |
tags: ${{ steps.meta.outputs.tags }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true |