mirror of
https://github.com/EndPositive/slipstream.git
synced 2025-10-08 12:25:04 +00:00
134 lines
3.8 KiB
YAML
134 lines
3.8 KiB
YAML
name: Release slipstream
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
env:
|
|
BUILD_TYPE: Release
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt install -y pkg-config libssl-dev ninja-build
|
|
|
|
- name: Configure CMake
|
|
run: |
|
|
cmake \
|
|
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
|
|
-DCMAKE_MAKE_PROGRAM=ninja \
|
|
-DCMAKE_C_COMPILER=clang \
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
|
-G Ninja \
|
|
-S ${{github.workspace}} \
|
|
-B ${{github.workspace}}/build
|
|
|
|
- name: Build with CMake
|
|
run: |
|
|
cmake \
|
|
--build ${{github.workspace}}/build \
|
|
-j $(nproc) \
|
|
--target slipstream-client slipstream-server
|
|
|
|
- name: Rename Binaries
|
|
run: |
|
|
VERSION=${{ github.ref_name }}
|
|
mv ${{github.workspace}}/build/slipstream-client ${{github.workspace}}/build/slipstream-client-${VERSION}-linux-x86_64
|
|
mv ${{github.workspace}}/build/slipstream-server ${{github.workspace}}/build/slipstream-server-${VERSION}-linux-x86_64
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: github.ref_type == 'tag'
|
|
with:
|
|
draft: true
|
|
generate_release_notes: true
|
|
files: |
|
|
build/slipstream-client-*
|
|
build/slipstream-server-*
|
|
|
|
docker-build:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
attestations: write
|
|
id-token: write
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Extract metadata (tags, labels) for Docker (server)
|
|
id: meta-server
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server
|
|
|
|
- name: Extract metadata (tags, labels) for Docker (client)
|
|
id: meta-client
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-client
|
|
|
|
- name: Build and push Docker image (server)
|
|
id: push-server
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta-server.outputs.tags }}
|
|
labels: ${{ steps.meta-server.outputs.labels }}
|
|
target: server
|
|
|
|
- name: Build and push Docker image (client)
|
|
id: push-client
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta-client.outputs.tags }}
|
|
labels: ${{ steps.meta-client.outputs.labels }}
|
|
target: client
|
|
|
|
- name: Generate artifact attestation (server)
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server
|
|
subject-digest: ${{ steps.push-server.outputs.digest }}
|
|
push-to-registry: true
|
|
|
|
- name: Generate artifact attestation (client)
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-client
|
|
subject-digest: ${{ steps.push-client.outputs.digest }}
|
|
push-to-registry: true
|