From bd11592a1b0ca3b14b754f3ebbad2eb5d7dabee3 Mon Sep 17 00:00:00 2001 From: Elias Wendland <193786789+eliaswen@users.noreply.github.com> Date: Wed, 1 Jul 2026 20:54:43 +0200 Subject: [PATCH] Release 0.1.0 --- .github/workflows/release.yml | 202 ++++++++++++++++++++++------------ 1 file changed, 134 insertions(+), 68 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4609b8..d1963d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,107 +23,168 @@ jobs: echo "match=false" >> $GITHUB_OUTPUT fi - build_executable: + build_gnu: needs: check-release if: needs.check-release.outputs.match == 'true' - strategy: - matrix: - include: - - target: x86_64-unknown-linux-gnu - binary: convertis - - target: x86_64-pc-windows-gnu - binary: convertis.exe - - target: x86_64-unknown-linux-musl - binary: convertis runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Checkout repo - - uses: dtolnay/rust-toolchain@stable - name: Set up Rust Toolchain with: - targets: ${{ matrix.target }} + targets: x86_64-unknown-linux-gnu + - name: Build + run: cargo build --release --target x86_64-unknown-linux-gnu + + - name: Rename Raw Executable + run: cp target/x86_64-unknown-linux-gnu/release/convertis convertis-x86_64-unknown-linux-gnu + - name: Upload Binary for Packaging + uses: actions/upload-artifact@v3 + with: + name: build-gnu + path: target/x86_64-unknown-linux-gnu/release/convertis + + - name: Upload Raw Executable Artifact + uses: actions/upload-artifact@v3 + with: + name: raw-gnu + path: convertis-x86_64-unknown-linux-gnu + + build_musl: + needs: check-release + if: needs.check-release.outputs.match == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-musl - name: Install cross-platform linkers run: | sudo apt-get update - if [ "${{ matrix.target }}" = "x86_64-pc-windows-gnu" ]; then - sudo apt-get install -y mingw-w64 - elif [ "${{ matrix.target }}" = "x86_64-unknown-linux-musl" ]; then - sudo apt-get install -y musl-tools - fi - + sudo apt-get install -y musl-tools - name: Build - run: cargo build --release --target ${{ matrix.target }} + run: cargo build --release --target x86_64-unknown-linux-musl + + - name: Rename Raw Executable + run: cp target/x86_64-unknown-linux-musl/release/convertis convertis-x86_64-unknown-linux-musl - - name: Upload Executable Artifact + - name: Upload Binary for Packaging uses: actions/upload-artifact@v3 with: - name: bin-${{ matrix.target }} - path: target/${{ matrix.target }}/release/${{ matrix.binary }} - - build_package: - needs: build_executable + name: build-musl + path: target/x86_64-unknown-linux-musl/release/convertis + + - name: Upload Raw Executable Artifact + uses: actions/upload-artifact@v3 + with: + name: raw-musl + path: convertis-x86_64-unknown-linux-musl + + build_windows: + needs: check-release if: needs.check-release.outputs.match == 'true' - strategy: - matrix: - include: - - type: deb-gnu - target: x86_64-unknown-linux-gnu - - type: deb-musl - target: x86_64-unknown-linux-musl - - type: rpm-gnu - target: x86_64-unknown-linux-gnu - - type: rpm-musl - target: x86_64-unknown-linux-musl - - type: exe - target: x86_64-pc-windows-gnu runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-gnu + - name: Install cross-platform linkers + run: | + sudo apt-get update + sudo apt-get install -y mingw-w64 + - name: Build + run: cargo build --release --target x86_64-pc-windows-gnu + - name: Upload Raw Executable Artifact + uses: actions/upload-artifact@v3 + with: + name: raw-windows + path: target/x86_64-pc-windows-gnu/release/convertis.exe + + package_gnu: + needs: [check-release, build_gnu] + if: needs.check-release.outputs.match == 'true' + strategy: + matrix: + type: [deb, rpm] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - name: Download compiled binary uses: actions/download-artifact@v3 with: - name: bin-${{ matrix.target }} - path: target/${{ matrix.target }}/release/ + name: build-gnu + path: target/x86_64-unknown-linux-gnu/release/ - - name: Install deb build dependencies - if: startsWith(matrix.type, 'deb-') - run: cargo install cargo-deb + - name: Install build dependencies + run: | + if [ "${{ matrix.type }}" = "deb" ]; then + cargo install cargo-deb + elif [ "${{ matrix.type }}" = "rpm" ]; then + cargo install cargo-generate-rpm + fi - - name: Install rpm build dependencies - if: startsWith(matrix.type, 'rpm-') - run: cargo install cargo-generate-rpm - - - name: Build deb - if: startsWith(matrix.type, 'deb-') - run: cargo deb --no-build --target ${{ matrix.target }} - - - name: Build rpm - if: startsWith(matrix.type, 'rpm-') - run: cargo generate-rpm --target-dir target/${{ matrix.target }} - - - name: Gather packages for upload + - name: Build package run: | mkdir -p dist/ - if [ "${{ matrix.type }}" = "exe" ]; then - cp target/${{ matrix.target }}/release/convertis.exe dist/ - elif [[ "${{ matrix.type }}" == deb-* ]]; then - cp target/${{ matrix.target }}/debian/*.deb dist/ - elif [[ "${{ matrix.type }}" == rpm-* ]]; then - cp target/${{ matrix.target }}/generate-rpm/*.rpm dist/ + if [ "${{ matrix.type }}" = "deb" ]; then + cargo deb --no-build --target x86_64-unknown-linux-gnu + cp target/x86_64-unknown-linux-gnu/debian/*.deb dist/ + elif [ "${{ matrix.type }}" = "rpm" ]; then + cargo generate-rpm --target-dir target/x86_64-unknown-linux-gnu + cp target/x86_64-unknown-linux-gnu/generate-rpm/*.rpm dist/ fi - name: Upload Package Artifact uses: actions/upload-artifact@v3 with: - name: pkg-${{ matrix.type }} + name: pkg-${{ matrix.type }}-gnu + path: dist/* + + package_musl: + needs: [check-release, build_musl] + if: needs.check-release.outputs.match == 'true' + strategy: + matrix: + type: [deb, rpm] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download compiled binary + uses: actions/download-artifact@v3 + with: + name: build-musl + path: target/x86_64-unknown-linux-musl/release/ + + - name: Install build dependencies + run: | + if [ "${{ matrix.type }}" = "deb" ]; then + cargo install cargo-deb + elif [ "${{ matrix.type }}" = "rpm" ]; then + cargo install cargo-generate-rpm + fi + + - name: Build package + run: | + mkdir -p dist/ + if [ "${{ matrix.type }}" = "deb" ]; then + cargo deb --no-build --target x86_64-unknown-linux-musl + cp target/x86_64-unknown-linux-musl/debian/*.deb dist/ + elif [ "${{ matrix.type }}" = "rpm" ]; then + cargo generate-rpm --target-dir target/x86_64-unknown-linux-musl + cp target/x86_64-unknown-linux-musl/generate-rpm/*.rpm dist/ + fi + + - name: Upload Package Artifact + uses: actions/upload-artifact@v3 + with: + name: pkg-${{ matrix.type }}-musl path: dist/* publish-release: - needs: [check-release, build_package] + needs: [check-release, build_windows, package_gnu, package_musl] runs-on: ubuntu-latest permissions: contents: write @@ -132,11 +193,16 @@ jobs: with: fetch-depth: 0 - - name: Download All Packages + - name: Download All Artifacts uses: actions/download-artifact@v3 with: path: all-packages/ + - name: Cleanup internal build artifacts + run: | + rm -rf all-packages/build-gnu + rm -rf all-packages/build-musl + - name: Generate Changelog run: | LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD) @@ -162,6 +228,6 @@ jobs: tag_name: v${{ needs.check-release.outputs.version }} name: Release v${{ needs.check-release.outputs.version }} body_path: changelog.md - files: all-packages/pkg-*/* + files: all-packages/**/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file