Skip to content

Commit

Permalink
ci: configure desktop release
Browse files Browse the repository at this point in the history
fix ci

ci: add desktop release for aarch64-apple-darwin

ci: release artifacts

bump version code

update release-desktop.yml

fix ci

fix ci

fix ci

fix ci

fix ci

fix ci

fix ci

fix ci

fix ci

fix ci
  • Loading branch information
tsirysndr committed Dec 6, 2022
1 parent 1279d7a commit 15bc547
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 7 deletions.
142 changes: 142 additions & 0 deletions .github/workflows/release-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
on:
release:
types: [created]
#on:
# push:
# branches: ["master"]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: ["master"]

jobs:
release:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.platform }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies (mac) only)
if: matrix.platform == 'macos-latest'
run: brew install protobuf
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libasound2-dev protobuf-compiler
- name: Install dependencies (windows only)
if: matrix.platform == 'windows-latest'
run: |
choco install protoc
choco install checksum
- name: Install Node Modules
run: |
cd webui/musicplayer
npm install -g yarn
yarn install --network-timeout 1000000000
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install aarch64-apple-darwin toolchain
if: matrix.platform == 'macos-latest'
run: rustup target add aarch64-apple-darwin
- name: Build App
run: |
cd webui/musicplayer
npx @tauri-apps/cli build
- name: Build App (macos arch64-apple-darwin)
if: matrix.platform == 'macos-latest'
run: |
cd webui/musicplayer
npx @tauri-apps/cli build --target aarch64-apple-darwin
- name: List files
if: matrix.platform == 'ubuntu-20.04' || matrix.platform == 'macos-latest'
run: |
ls target/release/bundle/*
- name: List files (windows)
if: matrix.platform == 'windows-latest'
run: |
dir target\release\bundle
dir target\release\bundle\*
- name: Set env
if: matrix.platform == 'ubuntu-20.04' || matrix.platform == 'macos-latest'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create archive (macos)
if: matrix.platform == 'macos-latest'
run: |
cd target/release/bundle
rm -f music-player-desktop_${{ env.RELEASE_VERSION }}_x86_64-apple-darwin.tar.gz
tar -czvf music-player-desktop_${{ env.RELEASE_VERSION }}_x86_64-apple-darwin.tar.gz "macos/Music Player.app"
shasum -a 256 music-player-desktop_${{ env.RELEASE_VERSION }}_x86_64-apple-darwin.tar.gz > music-player-desktop_${{ env.RELEASE_VERSION }}_x86_64-apple-darwin.tar.gz.sha256
rm -f dmg/Music_Player_${{ env.RELEASE_VERSION }}_x64.dmg
mv dmg/Music\ Player*_x64.dmg dmg/Music_Player_${{ env.RELEASE_VERSION }}_x64.dmg
shasum -a 256 dmg/Music_Player_${{ env.RELEASE_VERSION }}_x64.dmg > dmg/Music_Player_${{ env.RELEASE_VERSION }}_x64.dmg.sha256
cd ../../aarch64-apple-darwin/release/bundle
rm -f music-player-desktop_${{ env.RELEASE_VERSION }}_aarch64-apple-darwin.tar.gz
tar -czvf music-player-desktop_${{ env.RELEASE_VERSION }}_aarch64-apple-darwin.tar.gz "macos/Music Player.app"
shasum -a 256 music-player-desktop_${{ env.RELEASE_VERSION }}_aarch64-apple-darwin.tar.gz > music-player-desktop_${{ env.RELEASE_VERSION }}_aarch64-apple-darwin.tar.gz.sha256
rm -f dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg
mv dmg/Music\ Player*_aarch64.dmg dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg
shasum -a 256 dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg > dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg.sha256
- name: Releasing artifacts (macos)
if: matrix.platform == 'macos-latest'
uses: softprops/action-gh-release@v1
with:
files: |
target/release/bundle/music-player-desktop_${{ env.RELEASE_VERSION }}_x86_64-apple-darwin.tar.gz
target/release/bundle/music-player-desktop_${{ env.RELEASE_VERSION }}_x86_64-apple-darwin.tar.gz.sha256
target/release/bundle/dmg/Music_Player_${{ env.RELEASE_VERSION }}_x64.dmg
target/release/bundle/dmg/Music_Player_${{ env.RELEASE_VERSION }}_x64.dmg.sha256
target/aarch64-apple-darwin/release/bundle/music-player-desktop_${{ env.RELEASE_VERSION }}_aarch64-apple-darwin.tar.gz
target/aarch64-apple-darwin/release/bundle/music-player-desktop_${{ env.RELEASE_VERSION }}_aarch64-apple-darwin.tar.gz.sha256
target/aarch64-apple-darwin/release/bundle/dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg
target/aarch64-apple-darwin/release/bundle/dmg/Music_Player_${{ env.RELEASE_VERSION }}_aarch64.dmg.sha256
- name: Hash files (ubuntu)
if: matrix.platform == 'ubuntu-20.04'
run: |
rm -f target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb
rm -f target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage
mv target/release/bundle/appimage/music-player*.AppImage target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage
mv target/release/bundle/deb/music-player*.deb target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb
shasum -a 256 target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage > target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage.sha256
shasum -a 256 target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb > target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb.sha256
- name: Releasing artifacts (ubuntu)
if: matrix.platform == 'ubuntu-20.04'
uses: softprops/action-gh-release@v1
with:
files: |
target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage
target/release/bundle/appimage/music-player_${{ env.RELEASE_VERSION }}_amd64.AppImage.sha256
target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb
target/release/bundle/deb/music-player_${{ env.RELEASE_VERSION }}_amd64.deb.sha256
- name: Hash files (windows)
if: matrix.platform == 'windows-latest'
run: |
Remove-Item -Force target/release/bundle/msi/Music_Player_x64_en-US.msi
move target/release/bundle/msi/Music*.msi target/release/bundle/msi/Music_Player_x64_en-US.msi
checksum -t sha256 -f="target/release/bundle/msi/Music_Player_x64_en-US.msi" > target/release/bundle/msi/Music_Player_x64_en-US.msi.sha256
- name: Releasing artifacts (windows)
if: matrix.platform == 'windows-latest'
uses: softprops/action-gh-release@v1
with:
files: |
target/release/bundle/msi/Music_Player_x64_en-US.msi
target/release/bundle/msi/Music_Player_x64_en-US.msi.sha256
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.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "music-player"
version = "0.2.0-alpha.7"
version = "0.2.0-alpha.8"
edition = "2021"
repository = "https://github.com/tsirysndr/music-player"
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion webui/musicplayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"scripts": {
"start": "react-scripts start",
"build": "cross-env CI=false react-scripts build",
"tauri:build": "cross-env CI=false BROWSER=none REACT_APP_NATIVE_WRAPPER=tauri react-scripts build",
"tauri:dev": "cross-env BROWSER=none REACT_APP_NATIVE_WRAPPER=tauri react-scripts start",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down Expand Up @@ -100,4 +101,4 @@
"prop-types": "^15.8.1",
"webpack": "^5.74.0"
}
}
}
10 changes: 6 additions & 4 deletions webui/musicplayer/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"beforeBuildCommand": "yarn build",
"beforeBuildCommand": "yarn tauri:build",
"beforeDevCommand": "yarn tauri:dev",
"devPath": "http://localhost:3000",
"distDir": "../build",
Expand All @@ -18,7 +18,9 @@
"protocol": {
"all": false,
"asset": true,
"assetScope": ["$APPLOCALDATA/covers/*"]
"assetScope": [
"$APPLOCALDATA/covers/*"
]
}
},
"bundle": {
Expand Down Expand Up @@ -55,7 +57,7 @@
}
},
"security": {
"csp": "default-src 'self'; img-src 'self' asset: https://asset.localhost"
"csp": "img-src 'self' asset: https://asset.localhost"
},
"updater": {
"active": false
Expand All @@ -70,4 +72,4 @@
}
]
}
}
}

0 comments on commit 15bc547

Please sign in to comment.