Iceshrimp.NET/.forgejo/workflows/relese-tarballs.yaml
2024-04-12 02:40:17 +02:00

41 lines
1.6 KiB
YAML

on:
release:
types:
- published
jobs:
build-artifacts:
runs-on: docker
container:
image: mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim
permissions:
releases: write
steps:
- name: Prepare actions environment
run: |-
apt-get update && apt-get install nodejs zstd python3 -y
dotnet workload install wasm-tools
- name: Clone repository
run: git clone ${{ github.event.repository.clone_url }} --branch=${{ github.ref_name }} --depth=1 /src
- name: Setup go
uses: actions/setup-go@main
with:
go-version: '>=1.20.1'
- name: Build project
shell: bash
run: |-
cd /src/Iceshrimp.Backend
mkdir -p /out/{linux-x64,linux-arm64}
dotnet publish -c Release -r linux-x64 -o /out/linux-x64
dotnet publish -c Release -r linux-arm64 -o /out/linux-arm64
- name: Generate artifacts
shell: bash
run: |-
mkdir artifacts
tar cavf artifacts/${{ github.event.repository.name }}-${{ github.ref_name }}-linux-amd64.tar.zst --transform 's,^out/linux-x64,${{ github.event.repository.name }}-${{ github.ref_name }},' /out/linux-x64
tar cavf artifacts/${{ github.event.repository.name }}-${{ github.ref_name }}-linux-arm64.tar.zst --transform 's,^out/linux-arm64,${{ github.event.repository.name }}-${{ github.ref_name }},' /out/linux-arm64
- name: Upload artifacts
uses: actions/release-action@main
with:
files: |-
artifacts/**
api_key: '${{secrets.RELEASE_TOKEN}}'