mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-12-14 10:30:43 +01:00
235 lines
6.8 KiB
YAML
235 lines
6.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
create:
|
|
tags:
|
|
- 'v*' # Version tag
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
name: publish to crates.io
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: Swatinem/rust-cache@v1.0.1
|
|
- name: Publish crate
|
|
continue-on-error: true
|
|
run: cargo publish --manifest-path kalk/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose
|
|
- name: Publish CLI
|
|
run: sleep 20 && cargo publish --manifest-path kalk_cli/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose
|
|
|
|
publish_npm:
|
|
name: publish to npm
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: Swatinem/rust-cache@v1.0.1
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
registry-url: https://registry.npmjs.org/
|
|
- name: Install wasm-pack
|
|
run: cargo install --git https://github.com/rustwasm/wasm-pack.git --rev d46d1c69b788956160deed5e4e603f4f2780ffcf
|
|
- name: Build
|
|
run: |
|
|
yarn install
|
|
cd kalk
|
|
wasm-pack build --scope paddim8 -- --no-default-features
|
|
- name: Publish
|
|
run: |
|
|
sudo apt install expect
|
|
/usr/bin/expect <<EOD
|
|
spawn npm adduser
|
|
expect {
|
|
"Username:" {send "paddim8\r"; exp_continue}
|
|
"Password:" {send "${{ secrets.NPM_PASSWORD }}\r"; exp_continue}
|
|
"Email: (this IS public)" {send "bakk@tuta.io\r"; exp_continue}
|
|
}
|
|
EOD
|
|
wasm-pack publish -a public
|
|
|
|
publish_kalk_web:
|
|
name: publish kalk_web
|
|
runs-on: ubuntu-latest
|
|
needs: [publish_npm]
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
registry-url: https://registry.npmjs.org/
|
|
- name: build
|
|
run: |
|
|
cd kalk_web
|
|
npm install
|
|
- name: publish
|
|
run: echo success
|
|
- name: publish
|
|
run: |
|
|
cd kalk_web
|
|
sudo apt install expect
|
|
/usr/bin/expect <<EOD
|
|
spawn npm adduser
|
|
expect {
|
|
"Username:" {send "paddim8\r"; exp_continue}
|
|
"Password:" {send "${{ secrets.NPM_PASSWORD }}\r"; exp_continue}
|
|
"Email: (this IS public)" {send "bakk@tuta.io\r"; exp_continue}
|
|
}
|
|
EOD
|
|
npm publish
|
|
|
|
|
|
release_linux:
|
|
name: release linux
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: Swatinem/rust-cache@v1.0.1
|
|
- name: Compile
|
|
run: |
|
|
cargo build --release --verbose
|
|
cp target/release/kalk target/release/kalk-linux
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: binaries
|
|
path: target/release/kalk-linux
|
|
|
|
release_mac:
|
|
name: release mac
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry/index
|
|
~/.cargo/registry/cache
|
|
target
|
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
|
- name: Compile
|
|
run: |
|
|
cargo build --release --verbose
|
|
zip -r kalk-macOS.zip target/release/kalk
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: binaries
|
|
path: kalk-macOS.zip
|
|
|
|
release_windows:
|
|
name: release windows
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions/cache@v2
|
|
with:
|
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
|
path: |
|
|
C:\Users\runneradmin\.cargo\bin\cargo-wix
|
|
C:\Users\runneradmin\.cargo\registry\index
|
|
C:\Users\runneradmin\.cargo\registry\cache
|
|
C:\Users\runneradmin\.cargo\registry\cache
|
|
D:\a\kalk\kalk\target
|
|
C:\msys64\home\paddi\kalk\target
|
|
- uses: msys2/setup-msys2@v2
|
|
with:
|
|
update: true
|
|
install: >-
|
|
base-devel
|
|
pacman-mirrors
|
|
diffutils
|
|
m4
|
|
make
|
|
mingw-w64-x86_64-gcc
|
|
mingw-w64-x86_64-rust
|
|
continue-on-error: true
|
|
- shell: msys2 {0}
|
|
run: |
|
|
cargo build --release --verbose
|
|
|
|
- uses: crazy-max/ghaction-chocolatey@v1
|
|
with:
|
|
args: install wixtoolset -y
|
|
- shell: msys2 {0}
|
|
run: |
|
|
[ ! -f /c/Users/runneradmin/.cargo/bin/cargo-wix.exe ] && cargo install cargo-wix
|
|
cd kalk_cli
|
|
cargo wix --no-build --nocapture
|
|
mv target/wix/*.msi target/wix/kalk-windows.msi
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: binaries
|
|
path: kalk_cli/target/wix/kalk-windows.msi
|
|
|
|
release_android:
|
|
name: release android
|
|
runs-on: ubuntu-latest
|
|
needs: [publish_kalk_web]
|
|
defaults:
|
|
run:
|
|
working-directory: ./kalk_mobile
|
|
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
kalk_mobile/android/.gradle
|
|
kalk_mobile/android/build
|
|
kalk_mobile/android/app/build
|
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
|
- name: npm
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
- name: build app
|
|
run: |
|
|
npx cap sync
|
|
cd android
|
|
version=$(cat ../../kalk_web/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
|
|
APP_VERSION_NAME=$version ./gradlew assembleRelease
|
|
- uses: r0adkll/sign-android-release@v1
|
|
name: sign apk
|
|
with:
|
|
releaseDirectory: kalk_mobile/android/app/build/outputs/apk/release
|
|
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
|
alias: ${{ secrets.ALIAS }}
|
|
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
- run: mv $(ls -Art android/app/build/outputs/apk/release/*.apk | tail -n 1) ../kalk-android.apk
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: binaries
|
|
path: kalk-android.apk
|
|
|
|
create_release:
|
|
name: Create Release
|
|
if: always()
|
|
needs: [release_linux, release_mac, release_windows, release_android]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
- name: Download Artifact
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: binaries
|
|
- name: Upload Assets
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: ./*
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|