Skip to content

update test

update test #474

Workflow file for this run

name: release
on:
push:
workflow_dispatch:
env:
CARGO_INCREMENTAL: 0
permissions:
contents: write
jobs:
release:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
deb: true
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
deb: true
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
deb: true
- os: ubuntu-latest
target: i686-unknown-linux-musl
deb: true
- os: ubuntu-latest
target: aarch64-linux-android
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: get_version
uses: SebRollen/[email protected]
with:
file: Cargo.toml
field: package.version
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Setup cache
uses: Swatinem/[email protected]
with:
key: ${{ matrix.target }}
- name: Install cross
if: ${{ runner.os == 'Linux' }}
uses: actions-rs/cargo@v1
with:
command: install
args: --color=always --git=https://github.com/cross-rs/cross.git --locked --rev=02bf930e0cb0c6f1beffece0788f3932ecb2c7eb --verbose cross
- name: Build binary
uses: actions-rs/cargo@v1
env:
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
with:
command: build
args: --release --target=${{ matrix.target }} --color=always --verbose
use-cross: ${{ runner.os == 'Linux' }}
- name: Install cargo-deb
if: ${{ matrix.deb == true }}
uses: actions-rs/[email protected]
with:
crate: cargo-deb
- name: Build deb
if: ${{ matrix.deb == true }}
uses: actions-rs/cargo@v1
with:
command: deb
args: --no-build --no-strip --output=. --target=${{ matrix.target }}
- name: Package (*nix)
if: ${{ runner.os != 'Windows' }}
run: |
tar -cv LICENSE README.md \
-C target/${{ matrix.target }}/release/ vpm |
gzip --best > \
vpm-${{ steps.get_version.outputs.value }}-${{ matrix.target }}.tar.gz
- name: Create variable files
if: ${{ runner.os == 'Windows' }}
run: |
echo "${{ steps.get_version.outputs.value }}" > version.txt
echo "${{ matrix.target }}" >> target.txt
- name: Package (Windows)
if: ${{ runner.os == 'Windows' }}
uses: Minionguyjpro/[email protected]
with:
path: installer.iss
options: /O+
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
*.deb
*.tar.gz
*.zip
*.exe
- name: Create release
if: |
github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore(release)')
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
*.deb
*.tar.gz
*.zip
*.exe
name: ${{ steps.get_version.outputs.value }}
tag_name: ''