summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorIvan Potiienko <[email protected]>2026-08-31 22:07:34 +0200
committerIvan Potiienko <[email protected]>2026-08-31 22:07:34 +0200
commit531480d8983d063b982968ad199ae0b959d903df (patch)
tree3c9ebed481e6854d5065d7e3de07dc521b003916 /.github/workflows
parent3e964f98da759c438e6d3a0467df346de7a3d236 (diff)
downloadmikusays-c-531480d8983d063b982968ad199ae0b959d903df.tar.gz
mikusays-c-531480d8983d063b982968ad199ae0b959d903df.zip
Prepare v0.1.5 release
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml4
-rw-r--r--.github/workflows/package.yml87
-rw-r--r--.github/workflows/release.yml79
3 files changed, 96 insertions, 74 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3fdb6cc..63e65ae 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,10 +23,10 @@ jobs:
run: cargo fmt -- --check
- name: Run clippy
- run: cargo clippy -- -D warnings
+ run: cargo clippy --all-targets -- -D warnings
- name: Run tests
- run: cargo test --verbose
+ run: cargo test --all-targets --verbose
- name: Build
run: cargo build --verbose
diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml
index 01aa465..c34080b 100644
--- a/.github/workflows/package.yml
+++ b/.github/workflows/package.yml
@@ -23,10 +23,8 @@ jobs:
include:
- arch: x86_64
target: x86_64-unknown-linux-gnu
- deb_arch: amd64
- arch: aarch64
target: aarch64-unknown-linux-gnu
- deb_arch: arm64
steps:
- uses: actions/checkout@v4
@@ -55,10 +53,7 @@ jobs:
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')
- ARCH_NAME="${{ matrix.deb_arch }}"
- if [ "$ARCH_NAME" = "amd64" ]; then ARCH_NAME="x64"; fi
- DEB_NAME="mikusays-debian-${ARCH_NAME}-${VERSION}.deb"
- # Store version for later use
+ DEB_NAME="mikusays-debian-${{ matrix.arch }}-${VERSION}.deb"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "name=$DEB_NAME" >> $GITHUB_OUTPUT
@@ -68,29 +63,18 @@ jobs:
name: deb-package-${{ matrix.arch }}
path: ${{ steps.find-deb.outputs.path }}
- - name: Get release upload URL
- id: get-release
- if: github.event_name == 'release' || github.event.inputs.release_tag
- run: |
- if [ "${{ github.event_name }}" = "release" ]; then
- echo "upload_url=${{ github.event.release.upload_url }}" >> $GITHUB_OUTPUT
- else
- RELEASE_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
- "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.event.inputs.release_tag }}")
- UPLOAD_URL=$(echo "$RELEASE_DATA" | jq -r '.upload_url')
- echo "upload_url=$UPLOAD_URL" >> $GITHUB_OUTPUT
- fi
-
- name: Upload to release
if: github.event_name == 'release' || github.event.inputs.release_tag
- uses: actions/upload-release-asset@v1
env:
- GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- with:
- upload_url: ${{ steps.get-release.outputs.upload_url }}
- asset_path: ${{ steps.find-deb.outputs.path }}
- asset_name: mikusays-debian-${{ matrix.arch }}-${{ steps.find-deb.outputs.version }}.deb
- asset_content_type: application/vnd.debian.binary-package
+ GH_TOKEN: ${{ secrets.RELEASE_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 }})
@@ -102,10 +86,8 @@ jobs:
include:
- arch: x86_64
target: x86_64-unknown-linux-gnu
- rpm_arch: x86_64
- arch: aarch64
target: aarch64-unknown-linux-gnu
- rpm_arch: aarch64
steps:
- uses: actions/checkout@v4
@@ -145,10 +127,7 @@ jobs:
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')
- ARCH_NAME="${{ matrix.rpm_arch }}"
- if [ "$ARCH_NAME" = "x86_64" ]; then ARCH_NAME="x64"; fi
- RPM_NAME="mikusays-redhat-${ARCH_NAME}-${VERSION}.rpm"
- # Store version for later use
+ RPM_NAME="mikusays-redhat-${{ matrix.arch }}-${VERSION}.rpm"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "name=$RPM_NAME" >> $GITHUB_OUTPUT
@@ -158,26 +137,32 @@ jobs:
name: rpm-package-${{ matrix.arch }}
path: ${{ steps.find-rpm.outputs.path }}
- - name: Get release upload URL
- id: get-release
+ - name: Upload to release
if: github.event_name == 'release' || github.event.inputs.release_tag
+ env:
+ GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
+ RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }}
run: |
- if [ "${{ github.event_name }}" = "release" ]; then
- echo "upload_url=${{ github.event.release.upload_url }}" >> $GITHUB_OUTPUT
- else
- RELEASE_DATA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
- "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.event.inputs.release_tag }}")
- UPLOAD_URL=$(echo "$RELEASE_DATA" | jq -r '.upload_url')
- echo "upload_url=$UPLOAD_URL" >> $GITHUB_OUTPUT
- fi
+ 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
- - name: Upload to release
- if: github.event_name == 'release' || github.event.inputs.release_tag
- uses: actions/upload-release-asset@v1
+ 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:
- GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- with:
- upload_url: ${{ steps.get-release.outputs.upload_url }}
- asset_path: ${{ steps.find-rpm.outputs.path }}
- asset_name: mikusays-redhat-${{ matrix.arch }}-${{ steps.find-rpm.outputs.version }}.rpm
- asset_content_type: application/x-rpm
+ GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
+ RELEASE_TAG: ${{ github.event.release.tag_name || github.event.inputs.release_tag }}
+ run: |
+ gh api --method POST repos/xxanqw/apt-repository/dispatches \
+ --raw-field event_type=new-release \
+ --field "client_payload[tag_name]=$RELEASE_TAG"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e86ee25..46d410d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -113,10 +113,21 @@ jobs:
- name: Prepare artifact
run: |
- mkdir -p artifacts
+ mkdir -p artifacts staging
version="${{ needs.extract-version.outputs.version }}"
- cp target/${{ matrix.target }}/release/mikusays artifacts/mikusays-linux-${{ matrix.arch }}-$version
- chmod +x artifacts/mikusays-linux-${{ matrix.arch }}-$version
+ stem="mikusays-linux-${{ matrix.arch }}-$version"
+ cp target/${{ matrix.target }}/release/mikusays "staging/$stem"
+ chmod 755 "staging/$stem"
+ tar -C staging -czf "artifacts/$stem.tar.gz" "$stem"
+
+ - name: Verify artifact
+ run: |
+ version="${{ needs.extract-version.outputs.version }}"
+ stem="mikusays-linux-${{ matrix.arch }}-$version"
+ extract_dir="$(mktemp -d)"
+ tar -tzf "artifacts/$stem.tar.gz" | grep -Fx "$stem"
+ tar -xzf "artifacts/$stem.tar.gz" -C "$extract_dir"
+ test -x "$extract_dir/$stem"
- name: Upload artifact
uses: actions/upload-artifact@v4
@@ -150,10 +161,21 @@ jobs:
- name: Prepare artifact
run: |
- mkdir -p artifacts
+ mkdir -p artifacts staging
+ version="${{ needs.extract-version.outputs.version }}"
+ stem="mikusays-macos-${{ matrix.arch }}-$version"
+ cp target/${{ matrix.target }}/release/mikusays "staging/$stem"
+ chmod 755 "staging/$stem"
+ tar -C staging -czf "artifacts/$stem.tar.gz" "$stem"
+
+ - name: Verify artifact
+ run: |
version="${{ needs.extract-version.outputs.version }}"
- cp target/${{ matrix.target }}/release/mikusays artifacts/mikusays-macos-${{ matrix.arch }}-$version
- chmod +x artifacts/mikusays-macos-${{ matrix.arch }}-$version
+ stem="mikusays-macos-${{ matrix.arch }}-$version"
+ extract_dir="$(mktemp -d)"
+ tar -tzf "artifacts/$stem.tar.gz" | grep -Fx "$stem"
+ tar -xzf "artifacts/$stem.tar.gz" -C "$extract_dir"
+ test -x "$extract_dir/$stem"
- name: Upload artifact
uses: actions/upload-artifact@v4
@@ -179,7 +201,7 @@ jobs:
run: ls -R artifacts
- name: Create Release
- uses: softprops/action-gh-release@v1
+ uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
files: artifacts/mikusays-*
draft: false
@@ -195,33 +217,48 @@ jobs:
### Windows Installer
- **Any**: `mikusays-windows-inst-any-${{ needs.extract-version.outputs.version }}.exe`
- ### Linux (binary)
- - **x64**: `mikusays-linux-x64-${{ needs.extract-version.outputs.version }}`
- - **ARM64**: `mikusays-linux-arm64-${{ needs.extract-version.outputs.version }}`
+ ### Linux (tar.gz)
+ - **x64**: `mikusays-linux-x64-${{ needs.extract-version.outputs.version }}.tar.gz`
+ - **ARM64**: `mikusays-linux-arm64-${{ needs.extract-version.outputs.version }}.tar.gz`
### Debian Package
- - **x64 Debian Package**: `mikusays-debian-x64-${{ needs.extract-version.outputs.version }}.deb`
- - **ARM64 Debian Package**: `mikusays-debian-arm64-${{ needs.extract-version.outputs.version }}.deb`
+ - **x64 Debian Package**: `mikusays-debian-x86_64-${{ needs.extract-version.outputs.version }}.deb`
+ - **ARM64 Debian Package**: `mikusays-debian-aarch64-${{ needs.extract-version.outputs.version }}.deb`
### RedHat (RPM) Package
- - **x64 RPM Package**: `mikusays-redhat-x64-${{ needs.extract-version.outputs.version }}.rpm`
- - **ARM64 RPM Package**: `mikusays-redhat-arm64-${{ needs.extract-version.outputs.version }}.rpm`
+ - **x64 RPM Package**: `mikusays-redhat-x86_64-${{ needs.extract-version.outputs.version }}.rpm`
+ - **ARM64 RPM Package**: `mikusays-redhat-aarch64-${{ needs.extract-version.outputs.version }}.rpm`
### Repository for Debian / Ubuntu / Fedora / RHEL / CentOS
Information on how to add it available here https://apt.xxanqw.pp.ua
- ### macOS
- - **Intel (x64)**: `mikusays-macos-x64-${{ needs.extract-version.outputs.version }}`
- - **Apple Silicon (ARM64)**: `mikusays-macos-arm64-${{ needs.extract-version.outputs.version }}`
+ ### macOS (tar.gz)
+ - **Intel (x64)**: `mikusays-macos-x64-${{ needs.extract-version.outputs.version }}.tar.gz`
+ - **Apple Silicon (ARM64)**: `mikusays-macos-arm64-${{ needs.extract-version.outputs.version }}.tar.gz`
## Usage
```bash
- # Download the appropriate binary for your platform
- # On Unix-like systems, make it executable:
- chmod +x mikusays-*
+ # Download and extract the appropriate archive on Linux/macOS:
+ archive="mikusays-linux-x64-${{ needs.extract-version.outputs.version }}.tar.gz"
+ tar -xzf "$archive"
# Run the program:
- ./mikusays-* "Hello, World!"
+ "./${archive%.tar.gz}" "Hello, World!"
+
+ # If Gatekeeper blocks an unsigned macOS binary:
+ xattr -d com.apple.quarantine "./${archive%.tar.gz}"
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Notify package managers
+ env:
+ GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
+ RELEASE_TAG: v${{ needs.extract-version.outputs.version }}
+ run: |
+ gh api --method POST repos/xxanqw/scoop-bucket/dispatches \
+ --raw-field event_type=new-release \
+ --field "client_payload[tag_name]=$RELEASE_TAG"
+ gh api --method POST repos/xxanqw/homebrew-mikusays/dispatches \
+ --raw-field event_type=new-release \
+ --field "client_payload[tag_name]=$RELEASE_TAG"