feat(rln): publish rln artifacts nightly (#72)

* feat(rln): publish rln artifacts on push to master

* test(ci): check if artifacts are built on push to temp branch

* fix(ci): run tests only on changes to src

* fix(ci): add paths-ignore to prs

* fix(ci): make paths more explicit

* fix(ci): make publish workflow run

* fix(ci): revert back to master ref

* fix(ci): add os and sha to artifact name

* test(ci): trigger publish

* feat(ci): tar the artifacts

* test(ci): split ci and publish

* test(ci): only on master runs

* feat(ci): replace with nightly releaser

* chore(ci): extra newlines

* fix(ci): Spelling

Co-authored-by: G. <28568419+s1fr0@users.noreply.github.com>

* feat(ci): build and publish rln wasm

Co-authored-by: G. <28568419+s1fr0@users.noreply.github.com>
This commit is contained in:
Aaryamann Challani 2022-11-15 16:35:29 +05:30 committed by GitHub
parent fba905f45d
commit 3d943bccb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 182 additions and 0 deletions

View File

@ -2,7 +2,24 @@ on:
push: push:
branches: branches:
- master - master
paths-ignore:
- '**.md'
- '!.github/workflows/*.yml'
- '!multiplier/src/**'
- '!private-settlement/src/**'
- '!rln/src/**'
- '!rln-wasm/**'
- '!semaphore/src/**'
pull_request: pull_request:
paths-ignore:
- '**.md'
- '!.github/workflows/*.yml'
- '!multiplier/src/**'
- '!private-settlement/src/**'
- '!rln/src/**'
- '!rln-wasm/**'
- '!semaphore/src/**'
name: Tests name: Tests

165
.github/workflows/nightly-release.yml vendored Normal file
View File

@ -0,0 +1,165 @@
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
- name: Declare short sha
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Update git submodules
run: git submodule update --init --recursive
- name: cargo build
run: |
cargo build --release --workspace
mkdir release
cp target/release/librln* release/
tar -czvf linux-rln-${{steps.vars.outputs.sha_short}}.tar.gz release/
- name: Upload archive artifact
uses: actions/upload-artifact@v2
with:
name: linux-archive
path: linux-rln-${{steps.vars.outputs.sha_short}}.tar.gz
retention-days: 2
macos:
name: MacOS build
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
ref: master
- name: Declare short sha
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Update git submodules
run: git submodule update --init --recursive
- name: cargo build
run: |
cargo build --release --workspace
mkdir release
cp target/release/librln* release/
tar -czvf macos-rln-${{steps.vars.outputs.sha_short}}.tar.gz release/
- name: Upload archive artifact
uses: actions/upload-artifact@v2
with:
name: macos-archive
path: macos-rln-${{steps.vars.outputs.sha_short}}.tar.gz
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
- name: Declare short sha
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- 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/
tar -czvf browser-rln-wasm-${{steps.vars.outputs.sha_short}}.tar.gz release/
working-directory: rln-wasm
- name: Upload archive artifact
uses: actions/upload-artifact@v2
with:
name: browser-rln-wasm-archive
path: browser-rln-wasm-${{steps.vars.outputs.sha_short}}.tar.gz
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: Create release notes
run: |
echo "## Release notes" > release-notes.md
echo "### Linux" >> release-notes.md
tar -xvf linux-rln-*.tar.gz
ls -l release >> release-notes.md
echo "### MacOS" >> release-notes.md
tar -xvf macos-rln-*.tar.gz
ls -l release >> release-notes.md
echo "### Browser (RLN WASM)" >> release-notes.md
tar -xvf browser-rln-wasm-*.tar.gz
ls -l release >> release-notes.md
- 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: |
gh release create nightly --prerelease --target master \
--title 'Nightly build ("master" branch)' --notes-file release_notes.md \
linux-archive/* \
macos-archive/* \
browser-rln-wasm-archive/*
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