Skip to content

Commit

Permalink
👷 compile binaries for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Odonno committed Apr 29, 2023
1 parent 57c5eda commit fb810a2
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 54 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Main Workflow

on:
push:
branches:
- "main"

env:
CARGO_TERM_COLOR: always

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build
run: cargo build --verbose

- name: Download SurrealDB
run: curl -sSf https://install.surrealdb.com | sh

- name: Run tests
run: cargo test --verbose

- name: Publish crate
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
ignore-unpublished-changes: true

coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download SurrealDB
run: curl -sSf https://install.surrealdb.com | sh

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: "0.22.0"
args: "--engine llvm"

- name: Upload to codecov.io
uses: codecov/codecov-action@v3

- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Workflow
name: Pull Request Workflow

on:
pull_request:
Expand Down
69 changes: 20 additions & 49 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,33 @@
name: Release Workflow

on:
push:
branches:
- "main"

env:
CARGO_TERM_COLOR: always
release:
types: [created]

jobs:
release:
name: release ${{ matrix.target }}
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 tar.zst
- target: x86_64-apple-darwin
archive: zip

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build
run: cargo build --verbose

- name: Download SurrealDB
run: curl -sSf https://install.surrealdb.com | sh

- name: Run tests
run: cargo test --verbose

- name: Publish crate
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download SurrealDB
run: curl -sSf https://install.surrealdb.com | sh

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: "0.22.0"
args: "--engine llvm"

- name: Upload to codecov.io
uses: codecov/codecov-action@v3

- name: Archive code coverage results
uses: actions/upload-artifact@v1
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: code-coverage-report
path: cobertura.xml
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
EXTRA_FILES: "readme.md LICENSE"
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "surrealdb-migrations"
version = "0.9.3"
description = "An awesome CLI for SurrealDB migrations (provides commands to scaffold, create and apply migrations)."
version = "0.9.4"
description = "An awesome SurrealDB migration tool, with a user-friendly CLI and a versatile Rust library that enables seamless integration into any project."
authors = ["David Bottiau"]
repository = "https://github.com/Odonno/surrealdb-migrations/"
documentation = "https://docs.rs/surrealdb-migrations/"
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Crates.io](https://img.shields.io/crates/v/surrealdb-migrations) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Odonno/surrealdb-migrations/release.yml) ![GitHub](https://img.shields.io/github/license/Odonno/surrealdb-migrations) [![codecov](https://codecov.io/gh/Odonno/surrealdb-migrations/branch/main/graph/badge.svg?token=8DCQY63QP9)](https://codecov.io/gh/Odonno/surrealdb-migrations)
![Crates.io](https://img.shields.io/crates/v/surrealdb-migrations) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Odonno/surrealdb-migrations/main.yml) ![GitHub](https://img.shields.io/github/license/Odonno/surrealdb-migrations) [![codecov](https://codecov.io/gh/Odonno/surrealdb-migrations/branch/main/graph/badge.svg?token=8DCQY63QP9)](https://codecov.io/gh/Odonno/surrealdb-migrations)

# SurrealDB Migrations

Expand Down

0 comments on commit fb810a2

Please sign in to comment.