ci: remake #12
Workflow file for this run
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
name: release | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
create-release: | |
name: Create release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
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 |