diff options
| author | david <[email protected]> | 2026-10-05 23:08:45 -0300 |
|---|---|---|
| committer | david <[email protected]> | 2026-10-05 23:08:45 -0300 |
| commit | cc232721ad21e4f714467c56dfe064207e77db61 (patch) | |
| tree | 300bbf25ba353ad3d6fb582ce75d6d6d54de0289 /.github/workflows/package.yml | |
| parent | 0324a92037f1c830fa1c9e440024211d423dbea5 (diff) | |
| download | mikusays-c-cc232721ad21e4f714467c56dfe064207e77db61.tar.gz mikusays-c-cc232721ad21e4f714467c56dfe064207e77db61.zip | |
rewrote basic functionality to C. there are no colors just yet
Diffstat (limited to '.github/workflows/package.yml')
| -rw-r--r-- | .github/workflows/package.yml | 170 |
1 files changed, 0 insertions, 170 deletions
diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml deleted file mode 100644 index 7c1867c..0000000 --- a/.github/workflows/package.yml +++ /dev/null @@ -1,170 +0,0 @@ -name: Build Packages -permissions: - contents: read - -on: - release: - types: [created] - workflow_dispatch: - inputs: - release_tag: - description: 'Release tag to attach packages to (e.g., v0.1.3)' - required: false - type: string - -jobs: - build-deb: - name: Build DEB Package (${{ matrix.arch }}) - permissions: - contents: write - runs-on: ubuntu-latest - strategy: - matrix: - include: - - arch: x86_64 - target: x86_64-unknown-linux-gnu - - arch: aarch64 - target: aarch64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Install cross-compilation tools - if: matrix.arch == 'aarch64' - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - - name: Install cargo-deb - run: cargo install cargo-deb - - - name: Build DEB package - run: cargo deb --target ${{ matrix.target }} - env: - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - - - name: Find DEB package - id: find-deb - run: | - DEB_PATH=$(find target/${{ matrix.target }}/debian -name "*.deb" | head -n 1) - echo "path=$DEB_PATH" >> $GITHUB_OUTPUT - VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') - DEB_NAME="mikusays-debian-${{ matrix.arch }}-${VERSION}.deb" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "name=$DEB_NAME" >> $GITHUB_OUTPUT - - - name: Upload DEB artifact - uses: actions/upload-artifact@v4 - with: - name: deb-package-${{ matrix.arch }} - path: ${{ steps.find-deb.outputs.path }} - - - name: Upload to release - if: github.event_name == 'release' || github.event.inputs.release_tag - env: - GH_TOKEN: ${{ github.token }} - RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }} - run: | - install -m 0644 "${{ steps.find-deb.outputs.path }}" \ - "$RUNNER_TEMP/${{ steps.find-deb.outputs.name }}" - gh release upload "$RELEASE_TAG" \ - "$RUNNER_TEMP/${{ steps.find-deb.outputs.name }}" \ - --repo "$GITHUB_REPOSITORY" \ - --clobber - - build-rpm: - name: Build RPM Package (${{ matrix.arch }}) - permissions: - contents: write - runs-on: ubuntu-latest - strategy: - matrix: - include: - - arch: x86_64 - target: x86_64-unknown-linux-gnu - - arch: aarch64 - target: aarch64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.target }} - - - name: Install cross-compilation tools - if: matrix.arch == 'aarch64' - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - - name: Install cargo-generate-rpm - run: cargo install cargo-generate-rpm - - - name: Build release binary - run: cargo build --release --target ${{ matrix.target }} - env: - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc - - - name: Strip binary - run: | - if [ "${{ matrix.arch }}" = "aarch64" ]; then - aarch64-linux-gnu-strip target/${{ matrix.target }}/release/mikusays - else - strip target/${{ matrix.target }}/release/mikusays - fi - - - name: Generate RPM package - run: cargo generate-rpm --target ${{ matrix.target }} - - - name: Find RPM package - id: find-rpm - run: | - RPM_PATH=$(find target/${{ matrix.target }}/generate-rpm -name "*.rpm" | head -n 1) - echo "path=$RPM_PATH" >> $GITHUB_OUTPUT - VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') - RPM_NAME="mikusays-redhat-${{ matrix.arch }}-${VERSION}.rpm" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "name=$RPM_NAME" >> $GITHUB_OUTPUT - - - name: Upload RPM artifact - uses: actions/upload-artifact@v4 - with: - name: rpm-package-${{ matrix.arch }} - path: ${{ steps.find-rpm.outputs.path }} - - - name: Upload to release - if: github.event_name == 'release' || github.event.inputs.release_tag - env: - GH_TOKEN: ${{ github.token }} - RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }} - run: | - install -m 0644 "${{ steps.find-rpm.outputs.path }}" \ - "$RUNNER_TEMP/${{ steps.find-rpm.outputs.name }}" - gh release upload "$RELEASE_TAG" \ - "$RUNNER_TEMP/${{ steps.find-rpm.outputs.name }}" \ - --repo "$GITHUB_REPOSITORY" \ - --clobber - - notify-package-repository: - name: Notify package repository - runs-on: ubuntu-latest - needs: [build-deb, build-rpm] - if: github.event_name == 'release' || github.event.inputs.release_tag - permissions: - contents: read - steps: - - name: Dispatch exact release tag - env: - GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} - RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }} - run: | - if ! gh api --method POST repos/xxanqw/apt-repository/dispatches \ - --raw-field event_type=new-release \ - --field "client_payload[tag_name]=$RELEASE_TAG"; then - echo "::warning::Could not dispatch apt-repository; its daily schedule will publish the release. Check RELEASE_TOKEN if immediate updates are required." - fi |
