Skip to content

Commit

Permalink
add deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Oct 6, 2022
1 parent 7899ffd commit 5df4b1b
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 5 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: release

on:
workflow_dispatch:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]

jobs:

build-release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf

# Darwin
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin

# Windows
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: .exe

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
target: ${{ matrix.target }}
toolchain: stable

- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}

- name: Rename Artifacts
shell: bash
run: |
ver=${GITHUB_REF#refs/tags/}
ASSET_PATH=chapterize-$ver-${{ matrix.target }}${{ matrix.ext }}
mv target/${{ matrix.target }}/release/chapterize $ASSET_PATH
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.ASSET_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions 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 chapterize/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "chapterize"
version = "0.1.0"
version = "1.0.0"
edition = "2021"
description = "Parse EDLs to generate YouTube timestamps."

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
edl = { path = "../edl" }
clap = { verion = "4", features = ["derive"] }
clap = { version = "4", features = ["derive"] }
chrono = "0.4"
2 changes: 1 addition & 1 deletion edl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "edl"
version = "0.1.0"
version = "1.0.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down

0 comments on commit 5df4b1b

Please sign in to comment.