Skip to content

Commit

Permalink
add macos to CI (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah authored Mar 17, 2020
1 parent a232f15 commit c38ca5f
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 63 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,34 @@ Your karaoke collection can be browsed and queued from a self served website and

- [Setup](#setup)
- [Linux](#linux)
- [macOS](#macos)
- [Windows](#windows)
- [Build from Source](#build-from-source)
- [CLI Arguments](#cli-arguments)
- [Screenshots](#screenshots)
- [Songs Page](#songs-page)
- [Favorites Page](#favorites-page)
- [Artists Page](#artists-page)
- [Queue Page](#queue-page)
- [Player](#player)
- [Acknowledgments](#acknowledgments)

## Setup
### Linux
- Download latest release binary or build from source
- Download latest [release](https://github.com/tarkah/karaoke-rs/releases/latest) or build from source
- Run `karaoke-rs --help` to see all arguments
- Place your song collection at `~/.local/share/karaoke-rs/songs`, or specify location via `--songs path/to/song/directory`
- Default configuration file is created at `~/.config/karaoke-rs/config.yaml`. This can be copied / changed and specified via `--config path/to/config.yaml`
- You may need to force disable vsync to eliminate flickering, set environment variable `vblank_mode=0`

### macOS
- Download latest [release](https://github.com/tarkah/karaoke-rs/releases/latest) or build from source
- Run `karaoke-rs --help` to see all arguments
- Place your song collection at `$HOME/Library/Application Support/karaoke-rs/songs`, or specify location via `--songs path/to/song/directory`
- Default configuration file is created at `$HOME/Library/Preferences/karaoke-rs/config.yaml`. This can be copied / changed and specified via `--config path/to/config.yaml`

### Windows
- Download latest release binary or build from source
- Download latest [release](https://github.com/tarkah/karaoke-rs/releases/latest) or build from source
- Double click `karaoke-rs.exe` to run with default configuration. Run from command prompt / powershell `karaoke-rs.exe --help` to see all arguments
- Place your song collection at `%APPDATA%\karaoke-rs\songs`, or specify location via `--songs C:\path\to\song\directory`
- Default configuration file is created at `%APPDATA%\karaoke-rs\config.yaml`. This can be copied / changed and specified via `--config C:\path\to\config.yaml`
Expand Down Expand Up @@ -90,6 +98,9 @@ OPTIONS:
### Songs Page
![songs](/screenshots/songs.png?raw=true)

### Favorites Page
![favorites](/screenshots/favorites.png?raw=true)

### Artists Page
![artists](/screenshots/artists.png?raw=true)

Expand Down
131 changes: 70 additions & 61 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
trigger:
branches:
include: ['master', 'azure-pipelines']
include: ["master", "azure-pipelines"]
tags:
include: ['*']
include: ["*"]

variables:
rust_test_threads: 1

jobs:
- job: 'Frontend'
- job: "Frontend"
pool:
vmImage: 'ubuntu-latest'
vmImage: "ubuntu-latest"
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
Expand All @@ -25,16 +25,19 @@ jobs:
- publish: $(System.DefaultWorkingDirectory)/frontend
artifact: frontend

- job: 'Clippy'
dependsOn: 'Frontend'
- job: "Clippy"
dependsOn: "Frontend"
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
strategy:
matrix:
windows-stable:
imageName: 'windows-latest'
imageName: "windows-latest"
rustup_toolchain: stable
linux-stable:
imageName: 'ubuntu-latest'
imageName: "ubuntu-latest"
rustup_toolchain: stable
macos-stable:
imageName: "macOS-latest"
rustup_toolchain: stable

pool:
Expand All @@ -49,7 +52,7 @@ jobs:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Linux Install Rust
displayName: Linux Darwin Install Rust
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
Expand All @@ -64,29 +67,31 @@ jobs:
- task: CopyFiles@2
displayName: Copy frontend dist folder
inputs:
sourceFolder: '$(Pipeline.Workspace)/frontend/dist'
contents: '**'
targetFolder: '$(System.DefaultWorkingDirectory)/frontend/dist'
sourceFolder: "$(Pipeline.Workspace)/frontend/dist"
contents: "**"
targetFolder: "$(System.DefaultWorkingDirectory)/frontend/dist"

- script: rustup component add clippy
displayName: Install Clippy
- script: cargo clippy
displayName: Run Clippy


- job: 'Test'
dependsOn: 'Frontend'
- job: "Test"
dependsOn: "Frontend"
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
strategy:
matrix:
windows-stable:
imageName: 'windows-latest'
imageName: "windows-latest"
rustup_toolchain: stable
target: 'x86_64-pc-windows-msvc'
target: "x86_64-pc-windows-msvc"
linux-stable:
imageName: 'ubuntu-latest'
imageName: "ubuntu-latest"
rustup_toolchain: stable
target: "x86_64-unknown-linux-gnu"
macos-stable:
imageName: "macOS-latest"
rustup_toolchain: stable
target: 'x86_64-unknown-linux-gnu'

pool:
vmImage: $(imageName)
Expand All @@ -100,7 +105,7 @@ jobs:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Linux Install Rust
displayName: Linux Darwin Install Rust
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
Expand All @@ -115,41 +120,45 @@ jobs:
- task: CopyFiles@2
displayName: Copy frontend dist folder
inputs:
sourceFolder: '$(Pipeline.Workspace)/frontend/dist'
contents: '**'
targetFolder: '$(System.DefaultWorkingDirectory)/frontend/dist'
sourceFolder: "$(Pipeline.Workspace)/frontend/dist"
contents: "**"
targetFolder: "$(System.DefaultWorkingDirectory)/frontend/dist"

- script: cargo build
displayName: Cargo Build
- script: cargo test
displayName: Cargo Test


- job: 'Release'
dependsOn: 'Frontend'
- job: "Release"
dependsOn: "Frontend"
timeoutInMinutes: 0
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
strategy:
matrix:
windows-stable:
imageName: 'windows-latest'
imageName: "windows-latest"
rustup_toolchain: stable
target: 'x86_64-pc-windows-msvc'
target: "x86_64-pc-windows-msvc"
docker: false
linux-stable:
imageName: 'ubuntu-latest'
imageName: "ubuntu-latest"
rustup_toolchain: stable
target: "x86_64-unknown-linux-gnu"
docker: false
macos-stable:
imageName: "macOS-latest"
rustup_toolchain: stable
target: 'x86_64-unknown-linux-gnu'
target: "x86_64-apple-darwin"
docker: false
armv7-stable:
imageName: 'ubuntu-latest'
imageName: "ubuntu-latest"
rustup_toolchain: stable
target: 'armv7-unknown-linux-gnueabihf'
target: "armv7-unknown-linux-gnueabihf"
docker: true
aarch64-stable:
imageName: 'ubuntu-latest'
imageName: "ubuntu-latest"
rustup_toolchain: stable
target: 'aarch64-unknown-linux-gnu'
target: "aarch64-unknown-linux-gnu"
docker: true

pool:
Expand All @@ -175,7 +184,7 @@ jobs:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Linux Install Rust
displayName: Linux Darwin Install Rust
condition: and( ne( variables['Agent.OS'], 'Windows_NT' ), eq( variables['docker'], 'false' ))
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
Expand All @@ -190,9 +199,9 @@ jobs:
- task: CopyFiles@2
displayName: Copy frontend dist folder
inputs:
sourceFolder: '$(Pipeline.Workspace)/frontend/dist'
contents: '**'
targetFolder: '$(System.DefaultWorkingDirectory)/frontend/dist'
sourceFolder: "$(Pipeline.Workspace)/frontend/dist"
contents: "**"
targetFolder: "$(System.DefaultWorkingDirectory)/frontend/dist"

- script: cargo build --release
displayName: Cargo Build
Expand All @@ -202,59 +211,59 @@ jobs:
condition: eq( variables['docker'], 'false' )

- script: |
docker build -t tarkah/karaoke-rs:$TARGET ./ci/$TARGET/
docker build -t tarkah/karaoke-rs:$TARGET ./ci/$TARGET/
displayName: Cross Setup Docker
condition: eq( variables['docker'], 'true' )
- script: |
docker run -v "$(pwd):/source" tarkah/karaoke-rs:$TARGET cargo build --release --manifest-path /source/Cargo.toml --target $TARGET
docker run -v "$(pwd):/source" tarkah/karaoke-rs:$TARGET cargo build --release --manifest-path /source/Cargo.toml --target $TARGET
displayName: Cross Build
condition: eq( variables['docker'], 'true' )
- task: CopyFiles@2
displayName: Copy Binary
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
sourceFolder: "$(Build.SourcesDirectory)"
contents: |
target/**/release/?(karaoke-rs|karaoke-rs.exe)
targetFolder: '$(Build.BinariesDirectory)/karaoke-rs'
targetFolder: "$(Build.BinariesDirectory)/karaoke-rs"
flattenFolders: true
- task: CopyFiles@2
displayName: Copy Assets
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
sourceFolder: "$(Build.SourcesDirectory)"
contents: |
README.md
LICENSE
screenshots/**.*
targetFolder: '$(Build.BinariesDirectory)/karaoke-rs'
targetFolder: "$(Build.BinariesDirectory)/karaoke-rs"

- task: ArchiveFiles@2
displayName: Linux Archive
displayName: Linux Darwin Archive
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/karaoke-rs'
archiveType: 'tar'
tarCompression: 'gz'
archiveFile: '$(Build.ArtifactStagingDirectory)/karaoke-rs-$(build.my_tag)-$(TARGET).tar.gz'
rootFolderOrFile: "$(Build.BinariesDirectory)/karaoke-rs"
archiveType: "tar"
tarCompression: "gz"
archiveFile: "$(Build.ArtifactStagingDirectory)/karaoke-rs-$(build.my_tag)-$(TARGET).tar.gz"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- task: ArchiveFiles@2
displayName: Windows Archive
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/karaoke-rs'
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/karaoke-rs-$(build.my_tag)-$(TARGET).zip'
rootFolderOrFile: "$(Build.BinariesDirectory)/karaoke-rs"
archiveType: "zip"
archiveFile: "$(Build.ArtifactStagingDirectory)/karaoke-rs-$(build.my_tag)-$(TARGET).zip"
condition: eq( variables['Agent.OS'], 'Windows_NT' )

- task: GithubRelease@0
displayName: Publish Assets to Github Release
condition: succeeded()
inputs:
gitHubConnection: 'tarkah'
repositoryName: 'tarkah/karaoke-rs'
action: 'edit'
target: '$(build.sourceVersion)'
tagSource: 'manual'
tag: '$(build.my_tag)'
assets: '$(Build.ArtifactStagingDirectory)/*'
title: '$(build.my_tag) - $(build.date)'
assetUploadMode: 'replace'
gitHubConnection: "tarkah"
repositoryName: "tarkah/karaoke-rs"
action: "edit"
target: "$(build.sourceVersion)"
tagSource: "manual"
tag: "$(build.my_tag)"
assets: "$(Build.ArtifactStagingDirectory)/*"
title: "$(build.my_tag) - $(build.date)"
assetUploadMode: "replace"
addChangeLog: false
Binary file modified screenshots/artists.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/favorites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/player_1.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/player_2.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/queue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/songs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c38ca5f

Please sign in to comment.