-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
223 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: 'Install dependencies' | ||
description: 'Install project OS dependencies (according using Ubuntu)' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: sudo apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev libpango1.0-dev libgtk-3-dev | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: check-release | ||
|
||
on: | ||
push: | ||
branches: | ||
# - 'releases/**' FIXME BS NOW | ||
- '*' | ||
|
||
jobs: | ||
check-msys-mingw64: | ||
name: Check build for Windows | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup msys2 dependencies | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MINGW64 | ||
update: true | ||
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-rust mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-pkg-config | ||
|
||
- name: Run cargo check | ||
run: cargo check --release | ||
|
||
- name: Build | ||
run: cargo build --release | ||
|
||
check-linux: | ||
name: Check build for Linux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install OS dependencies | ||
run: sudo apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev libpango1.0-dev libgtk-3-dev | ||
|
||
- name: Run cargo check | ||
run: cargo check --release | ||
|
||
- name: Build | ||
run: cargo build --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
on: [push] | ||
|
||
name: Continuous integration | ||
|
||
jobs: | ||
check: | ||
name: 🔎 Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: setup | ||
uses: ./.github/actions/setup | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
test: | ||
name: 🧪 Test Suite | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: setup | ||
uses: ./.github/actions/setup | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
||
fmt: | ||
name: 🔤 Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: setup | ||
uses: ./.github/actions/setup | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
clippy: | ||
name: 🛃 Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: setup | ||
uses: ./.github/actions/setup | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add clippy | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,98 @@ | ||
name: Release | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
name: release ${{ matrix.target }} | ||
create-release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target: x86_64-pc-windows-gnu | ||
archive: zip | ||
- target: x86_64-unknown-linux-musl | ||
archive: tar.gz tar.xz | ||
- target: x86_64-apple-darwin | ||
archive: zip | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Compile and release | ||
uses: rust-build/rust-build.action@latest | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RUSTTARGET: ${{ matrix.target }} | ||
ARCHIVE_TYPES: ${{ matrix.archive }} | ||
PRE_BUILD: .github/workflows/deps.sh | ||
|
||
with: | ||
tag_name: ${{ github.ref_name }} | ||
release_name: Release ${{ github.ref_name }} | ||
# draft: false # FIXME | ||
draft: true | ||
# TODO : true if tag contain "rc" | ||
prerelease: false | ||
|
||
build-msys-mingw64: | ||
name: Build and package for Windows | ||
needs: create-release | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup msys2 dependencies | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MINGW64 | ||
update: true | ||
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-rust mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-pkg-config | ||
|
||
- name: Run cargo check | ||
run: cargo check --release | ||
|
||
- name: Build | ||
run: cargo build --release | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }} | ||
with: | ||
upload_url: ${{ env.UPLOAD_URL }} | ||
asset_path: target/release/trsync.exe # FIXME : zip all executables ? | ||
asset_name: trsync_${{ github.ref_name }}_Win64.zip | ||
asset_content_type: application/octet-stream | ||
|
||
build-linux: | ||
name: Build and package for Linux | ||
needs: create-release | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install OS dependencies | ||
run: sudo apt-get install -y build-essential pkg-config libssl-dev libsqlite3-dev libpango1.0-dev libgtk-3-dev | ||
|
||
- name: Run cargo check | ||
run: cargo check --release | ||
|
||
- name: Build | ||
run: cargo build --release | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }} | ||
with: | ||
upload_url: ${{ env.UPLOAD_URL }} | ||
asset_path: target/release/trsync # FIXME all in zip ? | ||
asset_name: trsync_${{ github.ref_name }}_Linux | ||
asset_content_type: application/octet-stream |
This file was deleted.
Oops, something went wrong.