Skip to content

Commit

Permalink
release ci add
Browse files Browse the repository at this point in the history
  • Loading branch information
cetin committed Nov 5, 2024
1 parent c0c61e8 commit 84e4e9f
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Release Clementine Binary

on:
push:
tags:
- "v*.*.*"

env:

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
x86_64_binary_extraction:
runs-on: ubicloud-standard-4
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
load: true
tags: clementine:latest
platforms: linux/arm64
- name: Run and extract binary
run: |
docker run -d --name test-container --entrypoint /bin/sh clementine:latest -c "while true; do sleep 30; done"
mkdir release
docker cp test-container:/clementine/target/release/server release/server
- name: Upload x86_64 Binary
uses: actions/upload-artifact@v4
with:
name: clementine_${{ github.ref_name }}_x86_64
path: release/server
linux_arm64_binary_extraction:
runs-on: ubicloud-standard-4-arm
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
load: true
tags: clementine:latest
platforms: linux/arm64
- name: Run and extract binary
run: |
docker run -d --name test-container --entrypoint /bin/sh clementine:latest -c "while true; do sleep 30; done"
mkdir release
docker cp test-container:/clementine/target/release/server release/server
- name: Upload ARM64 Binary
uses: actions/upload-artifact@v4
with:
name: clementine_${{ github.ref_name }}_linux_arm64
path: release/server

release:
needs: [x86_64_binary_extraction, linux_arm64_binary_extraction]
runs-on: ubuntu-latest
steps:
- name: Download x86_64 Binary
uses: actions/download-artifact@v4
with:
name: clementine_${{ github.ref_name }}_x86_64
path: release

- name: rename file
run: |
mv release/server release/clementine_${{ github.ref_name }}_x86_64
- name: Download Linux ARM64 Binary
uses: actions/download-artifact@v4
with:
name: clementine_${{ github.ref_name }}_linux_arm64
path: release

- name: rename file
run: |
mv release/server release/clementine_${{ github.ref_name }}_linux_arm64
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
release/clementine_${{ github.ref_name }}_linux_arm64
release/clementine_${{ github.ref_name }}_x86_64
name: Release ${{ github.ref_name }}
body: |
This is the release for version ${{ github.ref_name }}.
It includes:
- clementine_${{ github.ref_name }}_linux_arm64
- clementine_${{ github.ref_name }}_x86_64

0 comments on commit 84e4e9f

Please sign in to comment.