Skip to content

chore: bump version to 0.1.5 #20

chore: bump version to 0.1.5

chore: bump version to 0.1.5 #20

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: modparks-cli-windows
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: modparks-cli-linux
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: modparks-cli-macos
defaults:
run:
working-directory: ./
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Install cross-compilation tools (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y gcc-x86-64-linux-gnu libc6-dev-amd64-cross
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Create Deb Package (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
cargo install cargo-deb
cargo deb --target ${{ matrix.target }}
- name: Create MSI Package (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
cargo install cargo-wix
cargo wix --nocapture
- name: Package artifacts (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
# Archive binary as zip
Compress-Archive -Path target/${{ matrix.target }}/release/modparks-cli.exe -DestinationPath modparks-cli-${tag}-windows-x86_64.zip
# Copy MSI
if (Test-Path target/wix/modparks-cli*.msi) {
Copy-Item target/wix/modparks-cli*.msi "modparks-cli-${tag}-windows-x86_64.msi"
}
- name: Package artifacts (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
tag="${{ github.ref_name }}"
os_name=$(echo "${{ matrix.os }}" | cut -d'-' -f1)
if [ "${os_name}" = "ubuntu" ]; then os_name="linux"; fi
# Archive binary as tar.gz
tar -czvf "modparks-cli-${tag}-${os_name}-x86_64.tar.gz" -C target/${{ matrix.target }}/release modparks-cli
# Copy DEB
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
cp target/${{ matrix.target }}/debian/*.deb "modparks-cli-${tag}-ubuntu-x86_64.deb"
fi
# Calculate SHA256 for macOS (useful for Homebrew/MacPorts)
if [ "${{ matrix.os }}" = "macos-latest" ]; then
shasum -a 256 "modparks-cli-${tag}-${os_name}-x86_64.tar.gz" > "modparks-cli-${tag}-${os_name}-x86_64.tar.gz.sha256"
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
modparks-cli-*.zip
modparks-cli-*.tar.gz
modparks-cli-*.msi
modparks-cli-*.deb
modparks-cli-*.sha256
if-no-files-found: error
create-release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create Release and upload assets
uses: softprops/action-gh-release@v2
with:
name: "ModParks CLI ${{ github.ref_name }}"
body: |
## ModParks CLI ${{ github.ref_name }}
### インストール方法
**Windows (MSI Installer)**
`modparks-cli-${{ github.ref_name }}-windows-x86_64.msi` をダウンロードして実行してください。
**Ubuntu/Debian (Deb Package)**
`modparks-cli-${{ github.ref_name }}-ubuntu-x86_64.deb` をダウンロードし、以下を実行してください。
```bash
sudo dpkg -i modparks-cli-${{ github.ref_name }}-ubuntu-x86_64.deb
```
**ポータブル版 (ZIP / Tar.gz)**
お使いのOSに対応したアーカイブファイルをダウンロードし、解凍してパスの通ったディレクトリに配置してください。
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
files: artifacts/*
publish-winget:
name: Publish to Winget
needs: create-release
runs-on: windows-latest
steps:
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Pitan76.ModParksCLI
version: ${{ github.ref_name }}
token: ${{ secrets.WINGET_GH_TOKEN }}
publish-apt:
name: Publish APT Repository
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Install dpkg-dev, gnupg & apt-utils
run: sudo apt-get update && sudo apt-get install -y dpkg-dev gnupg apt-utils
- name: Import GPG Key
run: echo "${{ secrets.APT_GPG_PRIVATE_KEY }}" | gpg --batch --import
- name: Generate APT Repository
run: |
mkdir -p apt-repo/pool/main/
mkdir -p apt-repo/dists/stable/main/binary-amd64/
cp artifacts/*.deb apt-repo/pool/main/
cd apt-repo
dpkg-scanpackages --multiversion pool/main > dists/stable/main/binary-amd64/Packages
gzip -k -f dists/stable/main/binary-amd64/Packages
cat <<EOF > dists/stable/Release
Origin: ModParks
Label: ModParks CLI Repository
Suite: stable
Codename: stable
Architectures: amd64
Components: main
Description: Official ModParks APT Repository
Date: $(date -Ru)
EOF
cd dists/stable
apt-ftparchive release . >> Release
cd ../..
gpg --default-key "${{ secrets.APT_GPG_KEY_EMAIL }}" --passphrase "${{ secrets.APT_GPG_PASSPHRASE }}" --batch --yes --pinentry-mode loopback -abs -o dists/stable/Release.gpg dists/stable/Release
gpg --default-key "${{ secrets.APT_GPG_KEY_EMAIL }}" --passphrase "${{ secrets.APT_GPG_PASSPHRASE }}" --batch --yes --pinentry-mode loopback --clearsign -o dists/stable/InRelease dists/stable/Release
- name: Deploy APT Repo to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./apt-repo
keep_files: true
publish-homebrew:
name: Publish to Homebrew
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Bump Homebrew formula
uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: modparks-cli
homebrew-tap: Pitan76/homebrew-tap
download-url: https://github.com/Pitan76/ModParks-CLI/releases/download/${{ github.ref_name }}/modparks-cli-${{ github.ref_name }}-macos-x86_64.tar.gz
env:
COMMITTER_TOKEN: ${{ secrets.WINGET_GH_TOKEN }}