name: Build and Release on: push: branches: - main tags: - "v*" workflow_dispatch: permissions: contents: write releases: write jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install build toolchain run: | if command -v apt-get >/dev/null; then SUDO=$(command -v sudo || true) $SUDO apt-get update -y $SUDO apt-get install -y build-essential cmake fi - name: Build run: | mkdir build cd build cmake ../src cmake --build . --target unplayplay --config Release - name: Package binary run: | NAME=unplayplay-${GITHUB_REF_NAME:-dev}-linux-x64 mkdir -p dist-release cp build/unplayplay "dist-release/${NAME}" tar -czf "dist-release/${NAME}.tar.gz" -C build unplayplay ls -la dist-release - name: Create release and upload assets uses: https://gitea.com/actions/gitea-release-action@v1 with: tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('build-{0}', github.run_number) }} target_commitish: ${{ github.sha }} files: |- dist-release/*