Add release workflow
stable / fmt Details

This commit is contained in:
chmanie 2023-06-12 14:31:03 +02:00
parent a8bb7018b5
commit ed1fa8b693
3 changed files with 27 additions and 20 deletions

View File

@ -14,23 +14,4 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: cargo fmt --check - name: cargo fmt --check
run: cargo fmt --check --all run: cargo fmt --check --all
cross:
runs-on: rust-cross
name: stable / cross-${{ matrix.target }}
strategy:
fail-fast: false
matrix:
target: ["armv7-unknown-linux-gnueabihf", "aarch64-unknown-linux-gnu"]
steps:
- uses: actions/checkout@v3
- name: cross compile for ${{ matrix.target }}
run: cross build --target ${{ matrix.target }} --release
- uses: actions/release-action@main
with:
files: |-
target/${{ matrix.target }}/release/crabidy-server
api_key: '${{secrets.RELEASE_TOKEN}}'

View File

@ -0,0 +1,26 @@
name: CI release
run-name: CI release
on:
push:
tags:
- '*-?v[0-9]+*'
jobs:
release:
runs-on: rust-cross
name: stable / cross-${{ matrix.target }}
strategy:
fail-fast: false
matrix:
target: ["armv7-unknown-linux-gnueabihf", "aarch64-unknown-linux-gnu"]
steps:
- uses: actions/checkout@v3
- run: cargo fmt --check
- name: cross compile for ${{ matrix.target }}
run: cross build --target ${{ matrix.target }} --release
- uses: actions/release-action@main
with:
files: |-
target/${{ matrix.target }}/release/crabidy-server
api_key: '${{secrets.RELEASE_TOKEN}}'
pre_release: true

View File

@ -73,7 +73,7 @@ where
if let Some(config_dir) = dirs::config_dir() { if let Some(config_dir) = dirs::config_dir() {
let dir = Path::new(&config_dir).join("crabidy"); let dir = Path::new(&config_dir).join("crabidy");
if !dir.is_dir() { if !dir.is_dir() {
create_dir_all(&dir); create_dir_all(&dir).expect("Could not create crabidy config directory");
} }
let config_file_path = dir.join(config_file_name); let config_file_path = dir.join(config_file_name);
if !config_file_path.is_file() { if !config_file_path.is_file() {