diff --git a/.github/workflows/Ci.yml b/.github/workflows/Ci.yml index 4252b14..e8a2aa7 100644 --- a/.github/workflows/Ci.yml +++ b/.github/workflows/Ci.yml @@ -6,7 +6,7 @@ on: - release jobs: - build-docker-image: + build-and-push-docker-image: runs-on: ubuntu-latest steps: - name: Checkout code @@ -20,33 +20,39 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and Push Docker image - env: - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - run: | - echo $DOCKER_PASSWORD | docker login ghcr.io -u ${{ github.actor }} --password-stdin - docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/assetsart/easy-proxy:${{ github.sha }} . --push + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Pull and tag latest Docker image - run: | - docker pull ghcr.io/assetsart/easy-proxy:${{ github.sha }} - docker tag ghcr.io/assetsart/easy-proxy:${{ github.sha }} ghcr.io/assetsart/easy-proxy:latest - docker push ghcr.io/assetsart/easy-proxy:latest + - name: Build and Push Docker Image + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/assetsart/easy-proxy:${{ github.sha }},ghcr.io/assetsart/easy-proxy:latest build-and-release-binaries: runs-on: ubuntu-latest - needs: build-docker-image + needs: build-and-push-docker-image steps: - name: Checkout code uses: actions/checkout@v3 + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential pkg-config libssl-dev perl + - name: Set up Rust uses: actions/setup-rust@v1 with: rust-version: stable - name: Install cross - run: cargo install cross --git https://github.com/cross-rs/cross + run: cargo install cross - name: Build Linux binary run: | @@ -60,7 +66,7 @@ jobs: mkdir -p build/macos cp target/x86_64-apple-darwin/release/easy-proxy build/macos/ - - name: Create Release + - name: Create GitHub Release id: create_release uses: actions/create-release@v1 env: @@ -71,7 +77,7 @@ jobs: draft: false prerelease: false - - name: Upload Linux binary to Release + - name: Upload Linux Binary to Release uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -81,7 +87,7 @@ jobs: asset_name: easy-proxy-linux asset_content_type: application/octet-stream - - name: Upload macOS binary to Release + - name: Upload macOS Binary to Release uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 06eb311..384aa37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,8 @@ RUN set -eux; \ cmake \ libssl-dev \ make \ - pkg-config + pkg-config \ + perl WORKDIR /app # copy app src