Skip to content

Commit

Permalink
mimic
Browse files Browse the repository at this point in the history
  • Loading branch information
rucciva committed Sep 27, 2023
1 parent 907523d commit 9f10078
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Temp Release
name: Docker

on:
push:
Expand All @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions-rs/toolchain@v1s
with:
profile: minimal
toolchain: stable
Expand All @@ -28,40 +28,49 @@ jobs:
run: cross test --release --target x86_64-unknown-linux-musl --verbose
- name: Build release
run: cross build --release --target x86_64-unknown-linux-musl
- name: Run UPX
# Upx may not support some platforms. Ignore the errors
continue-on-error: true
uses: crazy-max/ghaction-upx@v1
with:
version: v4.0.2
files: target/x86_64-unknown-linux-musl/release/rathole
args: -q --best --lzma
- uses: actions/upload-artifact@v2
with:
name: rathole-x86_64-unknown-linux-musl
path: target/x86_64-unknown-linux-musl/release/rathole
- name: Zip Release
uses: TheDoctor0/[email protected]
with:
type: zip
filename: rathole-x86_64-unknown-linux-musl.zip
directory: target/x86_64-unknown-linux-musl/release/
path: rathole
- name: Publish
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/x86_64-unknown-linux-musl/release/rathole-x86_64-unknown-linux-muslss.zip
generate_release_notes: true
draft: true
docker:
name: Publish to Docker Hub
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: release
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

uses: docker/setup-buildx-action@v1
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- id: docker_build
name: Build and push Docker image
uses: docker/build-push-action@v3
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: linux/amd64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:${{ github.ref_name }}

0 comments on commit 9f10078

Please sign in to comment.