Skip to content

Commit

Permalink
[ADD] add cd action
Browse files Browse the repository at this point in the history
  • Loading branch information
betta-cyber committed Dec 16, 2019
1 parent 1f88143 commit e4c43e6
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Continuous Deployment

on:
push:
tags:
- "v*.*.*"

jobs:
publish:
name: Publishing for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
rust: [stable]
include:
- os: macos-latest
artifact_prefix: macos
target: x86_64-apple-darwin
- os: ubuntu-latest
artifact_prefix: linux
target: x86_64-unknown-linux-gnu

steps:
- name: Installing Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Installing needed macOS dependencies
if: matrix.os == 'macos-latest'
run: |
brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav
export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
- name: Installing needed Ubuntu dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y -qq pkg-config libgstreamer-plugins-bad1.0-dev
- name: Checking out sources
uses: actions/checkout@v1
- name: Running cargo build
uses: actions-rs/cargo@v1
with:
command: build
toolchain: ${{ matrix.rust }}
args: --release --target ${{ matrix.target }}

- name: Packaging final binary
shell: bash
run: |
cd target/${{ matrix.target }}/release
strip ncmt
tar czvf netease-music-tui-${{ matrix.artifact_prefix }}.tar.gz ncmt
shasum -a 256 netease-music-tui-${{ matrix.artifact_prefix }}.tar.gz > netease-music-tui-${{ matrix.artifact_prefix }}.sha256
- name: Releasing assets
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.target }}/release/netease-music-tui-${{ matrix.artifact_prefix }}.tar.gz
target/${{ matrix.target }}/release/netease-music-tui-${{ matrix.artifact_prefix }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e4c43e6

Please sign in to comment.