Skip to content

Commit

Permalink
Merge pull request #74 from muzik-apps/main-app-dev
Browse files Browse the repository at this point in the history
Preparing v0.6.0 release
  • Loading branch information
waveyboym authored Nov 23, 2024
2 parents 72142e0 + 76d7ef4 commit ef18ec9
Show file tree
Hide file tree
Showing 180 changed files with 14,491 additions and 3,767 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: 'build-and-release'

on:
workflow_dispatch:
push:
branches:
- releases

defaults:
run:
working-directory: muzik-offline

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
# This must match the platform value defined above.
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm' # Set this to npm, yarn or pnpm.

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: npm install # change this to npm or pnpm depending on which one you use.

- name: Install OpenSSL
run: |
if [[ "${{ matrix.platform }}" == "macos-latest" ]]; then
brew install openssl
elif [[ "${{ matrix.platform }}" == "ubuntu-22.04" ]]; then
sudo apt-get update && sudo apt-get install -y openssl
elif [[ "${{ matrix.platform }}" == "windows-latest" ]]; then
choco install openssl -y
fi
- name: Verify OpenSSL Installation
run: openssl version

- name: Decrypt the environment variables in src-tauri/.env.enc
run: |
openssl enc -d -aes-256-cbc -pbkdf2 -in src-tauri/.env.enc -out src-tauri/.env -pass pass:${{ secrets.ENCRYPTION_PASSWORD }}
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: 'App v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 muzik-offline

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,19 @@ DISCORD_CLIENT_ID=<Your client id goes here>
```
npm run tauri dev
```
11. You can encrypt your env file with:
```
openssl enc -aes-256-cbc -salt -pbkdf2 -in src-tauri/.env -out src-tauri/.env.enc -pass pass:{pass-key}
```

## Building
1. Clone the <a href="https://github.com/muzik-apps/muzik-offline/tree/releases">releases</a> branch. It is the most stable and ready to go branch
2. Before you create a build, you will have to embed any env variables into the rust code otherwise the application will panic if you try to run it. The env variables are only meant to be used in the development cycle.
3. To embed the env variables, copy your ```DISCORD_CLIENT_ID``` from the ```.env``` file.
4. Go to <a href="https://github.com/muzik-apps/muzik-offline/blob/main-app-dev/muzik-offline/src-tauri/src/socials/discord_rpc.rs">discord_rpc.rs</a> and comment out these snippets of code:
```
3 -> use dotenv::dotenv;
4 -> use std::env;
15 -> //get client id from env variables
16 -> dotenv().ok();
17 -> let client_id = env::var("DISCORD_CLIENT_ID").expect("DISCORD_CLIENT_ID env variable not set");
```
5. In this snippet of code ```let client: DiscordIpcClient = DiscordIpcClient::new(&client_id)?;```, replace ```&client_id``` with ```"<Your client id goes here>"```
6. You can also remove the <a href="https://github.com/muzik-apps/muzik-offline/blob/main-app-dev/muzik-offline/src-tauri/Cargo.toml#L30">dotnev crate</a> by just removing that line of code.
7. If you want to go back to dev, you will have to undo all the steps above.
8. If you want to create a production build, run
4. If you want to create a production build, run
```
npm run tauri build
```
9. If you want to create a <a href="https://tauri.app/v1/guides/debugging/application#using-the-inspector-in-production">debug production build</a>(one where you have access to devtools), run
5. If you want to create a <a href="https://tauri.app/v1/guides/debugging/application#using-the-inspector-in-production">debug production build</a>(one where you have access to devtools), run
```
npm run tauri build -- --debug
```
Expand Down
Loading

0 comments on commit ef18ec9

Please sign in to comment.