2020-12-12 21:49:08 +01:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
create:
|
|
|
|
tags:
|
|
|
|
- 'v*' # Version tag
|
2022-01-01 17:57:15 +01:00
|
|
|
workflow_dispatch:
|
2020-12-12 21:49:08 +01:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
publish:
|
2020-12-12 21:53:07 +01:00
|
|
|
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
|
2021-06-02 22:37:24 +02:00
|
|
|
run: sleep 20 && cargo publish --manifest-path cli/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose
|
2021-01-01 17:44:56 +01:00
|
|
|
|
|
|
|
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
|
2023-07-20 21:18:20 +02:00
|
|
|
run: cargo install wasm-pack
|
2021-01-01 17:44:56 +01:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
yarn install
|
|
|
|
cd kalk
|
|
|
|
wasm-pack build --scope paddim8 -- --no-default-features
|
2022-01-01 17:49:42 +01:00
|
|
|
cd ..
|
|
|
|
- uses: JS-DevTools/npm-publish@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
|
|
package: ./kalk/pkg/package.json
|
|
|
|
access: public
|
2021-05-27 16:57:53 +02:00
|
|
|
|
|
|
|
publish_kalk_web:
|
|
|
|
name: publish kalk_web
|
2021-06-02 23:36:20 +02:00
|
|
|
if: always()
|
2021-05-27 16:57:53 +02:00
|
|
|
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: |
|
2021-06-02 22:32:30 +02:00
|
|
|
cd web
|
2021-05-27 16:57:53 +02:00
|
|
|
npm install
|
2022-01-01 17:49:42 +01:00
|
|
|
cd ..
|
|
|
|
- uses: JS-DevTools/npm-publish@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
|
|
package: ./web/package.json
|
|
|
|
access: public
|
2021-05-27 16:57:53 +02:00
|
|
|
|
2020-12-12 21:49:08 +01:00
|
|
|
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
|
2021-06-02 22:32:30 +02:00
|
|
|
cp target/release/kalker target/release/kalker-linux
|
2020-12-12 21:49:08 +01:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: binaries
|
2021-06-02 22:32:30 +02:00
|
|
|
path: target/release/kalker-linux
|
2020-12-12 21:49:08 +01:00
|
|
|
|
|
|
|
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: |
|
2020-12-12 23:08:50 +01:00
|
|
|
cargo build --release --verbose
|
2021-06-02 22:32:30 +02:00
|
|
|
zip -r kalker-macOS.zip target/release/kalker
|
2020-12-12 21:49:08 +01:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: binaries
|
2021-06-02 22:32:30 +02:00
|
|
|
path: kalker-macOS.zip
|
2020-12-12 21:49:08 +01:00
|
|
|
|
|
|
|
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
|
2022-06-03 01:04:26 +02:00
|
|
|
{FOLDERID_LocalAppData}\gmp-mpfr-sys
|
2021-06-02 22:32:30 +02:00
|
|
|
D:\a\kalker\kalker\target
|
|
|
|
C:\msys64\home\paddi\kalker\target
|
2020-12-12 21:49:08 +01:00
|
|
|
- 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
|
2021-05-18 23:38:35 +02:00
|
|
|
continue-on-error: true
|
2020-12-12 21:49:08 +01:00
|
|
|
- shell: msys2 {0}
|
|
|
|
run: |
|
|
|
|
cargo build --release --verbose
|
|
|
|
|
|
|
|
- uses: crazy-max/ghaction-chocolatey@v1
|
|
|
|
with:
|
|
|
|
args: install wixtoolset -y
|
|
|
|
- shell: msys2 {0}
|
|
|
|
run: |
|
2022-06-03 01:45:08 +02:00
|
|
|
[ ! -f /c/Users/runneradmin/.cargo/bin/cargo-wix.exe ] && cargo install cargo-wix --version 0.3.1
|
2021-06-02 22:32:30 +02:00
|
|
|
cd cli
|
2022-06-03 02:18:01 +02:00
|
|
|
cargo wix --no-build --nocapture
|
2021-06-02 22:32:30 +02:00
|
|
|
mv target/wix/*.msi target/wix/kalker-windows.msi
|
2020-12-12 21:49:08 +01:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: binaries
|
2021-06-02 22:32:30 +02:00
|
|
|
path: cli/target/wix/kalker-windows.msi
|
2020-12-12 21:49:08 +01:00
|
|
|
|
2021-05-25 14:53:19 +02:00
|
|
|
release_android:
|
|
|
|
name: release android
|
2021-06-02 23:25:28 +02:00
|
|
|
if: always()
|
2021-05-25 14:53:19 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-27 16:57:53 +02:00
|
|
|
needs: [publish_kalk_web]
|
2021-05-25 14:53:19 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
2021-06-02 22:32:30 +02:00
|
|
|
working-directory: ./mobile
|
2021-05-25 14:53:19 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
2021-06-02 22:32:30 +02:00
|
|
|
mobile/android/.gradle
|
|
|
|
mobile/android/build
|
|
|
|
mobile/android/app/build
|
2021-05-25 14:53:19 +02:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
|
|
|
- name: npm
|
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run build
|
|
|
|
- name: build app
|
|
|
|
run: |
|
|
|
|
npx cap sync
|
|
|
|
cd android
|
2021-06-02 22:32:30 +02:00
|
|
|
version=$(cat ../../web/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
|
2021-05-27 16:57:53 +02:00
|
|
|
APP_VERSION_NAME=$version ./gradlew assembleRelease
|
2024-03-23 03:00:23 +01:00
|
|
|
- name: Setup build tool version variable
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
|
|
|
|
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
|
|
|
|
echo Last build tool version is: $BUILD_TOOL_VERSION
|
2021-05-25 14:53:19 +02:00
|
|
|
- uses: r0adkll/sign-android-release@v1
|
|
|
|
name: sign apk
|
|
|
|
with:
|
2021-06-02 22:32:30 +02:00
|
|
|
releaseDirectory: mobile/android/app/build/outputs/apk/release
|
2021-05-25 14:53:19 +02:00
|
|
|
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
|
|
|
|
alias: ${{ secrets.ALIAS }}
|
|
|
|
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
|
|
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
2024-03-23 03:00:23 +01:00
|
|
|
env:
|
|
|
|
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }}
|
2021-06-02 22:32:30 +02:00
|
|
|
- run: mv $(ls -Art android/app/build/outputs/apk/release/*.apk | tail -n 1) ../kalker-android.apk
|
2021-05-25 14:53:19 +02:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: binaries
|
2021-06-02 22:32:30 +02:00
|
|
|
path: kalker-android.apk
|
2021-05-25 14:53:19 +02:00
|
|
|
|
2020-12-12 21:49:08 +01:00
|
|
|
create_release:
|
|
|
|
name: Create Release
|
2021-05-18 23:58:13 +02:00
|
|
|
if: always()
|
2021-05-25 14:53:19 +02:00
|
|
|
needs: [release_linux, release_mac, release_windows, release_android]
|
2020-12-12 21:49:08 +01:00
|
|
|
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:
|
2021-05-18 23:38:35 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|