2022-11-15 11:05:29 +00:00
|
|
|
name: Nightly build
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *"
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
linux:
|
|
|
|
name: Linux build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
2022-11-16 14:36:17 +00:00
|
|
|
- name: Install stable toolchain
|
2022-11-15 11:05:29 +00:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
2022-11-16 14:36:17 +00:00
|
|
|
toolchain: stable
|
2022-11-15 11:05:29 +00:00
|
|
|
override: true
|
|
|
|
- name: Update git submodules
|
|
|
|
run: git submodule update --init --recursive
|
|
|
|
- name: cargo build
|
|
|
|
run: |
|
2022-11-16 14:36:17 +00:00
|
|
|
cargo build --release --workspace --exclude rln-wasm
|
2022-11-15 11:05:29 +00:00
|
|
|
mkdir release
|
|
|
|
cp target/release/librln* release/
|
2022-11-16 14:36:17 +00:00
|
|
|
tar -czvf linux-rln.tar.gz release/
|
2022-11-15 11:05:29 +00:00
|
|
|
|
|
|
|
- name: Upload archive artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: linux-archive
|
2022-11-16 14:36:17 +00:00
|
|
|
path: linux-rln.tar.gz
|
2022-11-15 11:05:29 +00:00
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
macos:
|
|
|
|
name: MacOS build
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: master
|
2022-11-16 14:36:17 +00:00
|
|
|
- name: Install stable toolchain
|
2022-11-15 11:05:29 +00:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
2022-11-16 14:36:17 +00:00
|
|
|
toolchain: stable
|
2022-11-15 11:05:29 +00:00
|
|
|
override: true
|
|
|
|
- name: Update git submodules
|
|
|
|
run: git submodule update --init --recursive
|
|
|
|
- name: cargo build
|
|
|
|
run: |
|
2022-11-16 14:36:17 +00:00
|
|
|
cargo build --release --workspace --exclude rln-wasm
|
2022-11-15 11:05:29 +00:00
|
|
|
mkdir release
|
|
|
|
cp target/release/librln* release/
|
2022-11-16 14:36:17 +00:00
|
|
|
tar -czvf macos-rln.tar.gz release/
|
2022-11-15 11:05:29 +00:00
|
|
|
|
|
|
|
- name: Upload archive artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: macos-archive
|
2022-11-16 14:36:17 +00:00
|
|
|
path: macos-rln.tar.gz
|
2022-11-15 11:05:29 +00:00
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
browser-rln-wasm:
|
|
|
|
name: Browser build (RLN WASM)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- run: git submodule update --init --recursive
|
|
|
|
- name: Install wasm-pack
|
|
|
|
uses: jetli/wasm-pack-action@v0.3.0
|
|
|
|
- name: Install cargo-make
|
|
|
|
run: cargo install cargo-make
|
|
|
|
- name: cargo make build
|
|
|
|
run: |
|
|
|
|
cargo make build
|
|
|
|
mkdir release
|
|
|
|
cp pkg/** release/
|
2022-11-16 14:36:17 +00:00
|
|
|
tar -czvf browser-rln-wasm.tar.gz release/
|
2022-11-15 11:05:29 +00:00
|
|
|
working-directory: rln-wasm
|
|
|
|
|
|
|
|
- name: Upload archive artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: browser-rln-wasm-archive
|
2022-11-16 14:36:17 +00:00
|
|
|
path: rln-wasm/browser-rln-wasm.tar.gz
|
2022-11-15 11:05:29 +00:00
|
|
|
retention-days: 2
|
|
|
|
|
|
|
|
|
|
|
|
prepare-prerelease:
|
|
|
|
name: Prepare pre-release
|
|
|
|
needs: [linux, macos, browser-rln-wasm]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
|
|
|
|
- name: Delete tag
|
|
|
|
uses: dev-drprasad/delete-tag-and-release@v0.2.0
|
|
|
|
with:
|
|
|
|
delete_release: true
|
|
|
|
tag_name: nightly
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Create prerelease
|
|
|
|
run: |
|
2022-11-16 14:36:17 +00:00
|
|
|
start_tag=$(gh release list -L 2 --exclude-drafts | grep -v nightly | cut -d$'\t' -f3)
|
2022-11-15 11:05:29 +00:00
|
|
|
gh release create nightly --prerelease --target master \
|
2022-11-16 14:36:17 +00:00
|
|
|
--title 'Nightly build ("master" branch)' \
|
|
|
|
--generate-notes \
|
|
|
|
--notes-start-tag $start_tag \
|
|
|
|
linux-archive/linux-rln.tar.gz \
|
|
|
|
macos-archive/macos-rln.tar.gz \
|
|
|
|
browser-rln-wasm-archive/browser-rln-wasm.tar.gz
|
2022-11-15 11:05:29 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Delete artifacts
|
|
|
|
uses: geekyeggo/delete-artifact@v1
|
|
|
|
with:
|
|
|
|
failOnError: false
|
|
|
|
name: |
|
|
|
|
linux-archive
|
|
|
|
macos-archive
|
|
|
|
browser-rln-wasm-archive
|