Skip to content

chore: bump version to v1.0.3 and update docs #21

chore: bump version to v1.0.3 and update docs

chore: bump version to v1.0.3 and update docs #21

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
target: x86_64-unknown-linux-gnu
artifact: ghgrab
release_name: ghgrab-linux
- os: ubuntu-latest
platform: linux-arm64
target: aarch64-unknown-linux-gnu
artifact: ghgrab
release_name: ghgrab-linux-arm64
- os: macos-latest
platform: darwin
target: x86_64-apple-darwin
artifact: ghgrab
release_name: ghgrab-darwin
- os: macos-latest
platform: darwin-arm64
target: aarch64-apple-darwin
artifact: ghgrab
release_name: ghgrab-darwin-arm64
- os: windows-latest
platform: win32
target: x86_64-pc-windows-msvc
artifact: ghgrab.exe
release_name: ghgrab-win32.exe
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools (Linux ARM64)
if: matrix.platform == 'linux-arm64'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Rename artifact
shell: bash
run: |
src="target/${{ matrix.target }}/release/${{ matrix.artifact }}"
dst="${{ matrix.release_name }}"
cp "$src" "$dst"
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.release_name }}
path: ${{ matrix.release_name }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./binaries
merge-multiple: true
- name: List binaries
run: ls -lh ./binaries/
- name: Generate Checksums
run: |
python -c "
import os, hashlib, json
res = {}
for f in os.listdir('binaries'):
path = os.path.join('binaries', f)
if os.path.isfile(path):
with open(path, 'rb') as fp:
res[f] = hashlib.sha256(fp.read()).hexdigest()
with open('checksums.json', 'w') as out:
json.dump(res, out, indent=2)
"
cat checksums.json
- name: Upload Checksums Artifact
uses: actions/upload-artifact@v4
with:
name: checksums
path: checksums.json
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
binaries/*
checksums.json
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
needs: release
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Update npm
run: npm install -g npm@latest
- name: Download Checksums
uses: actions/download-artifact@v4
with:
name: checksums
- name: Publish to npm
run: npm publish --provenance --access public
publish-pypi:
needs: release
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Download Checksums
uses: actions/download-artifact@v4
with:
name: checksums
- name: Build sdist
run: |
python -m pip install build
python -m build --sdist
- name: List dist directory
run: ls -lh dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish-crates:
needs: release
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Authenticate with crates.io
uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: Publish to crates.io
run: cargo publish --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}