fix(ci): exclude rln-wasm since it has its own step now (#73)

* fix(ci): exclude rln-wasm since it has its own step now

* fix(ci): use stable toolchain

* fix(ci): paths for release notes

* fix(ci): release path

* test(ci): check the tree for filepaths

* test(ci): check the tree for filepaths

* test(ci): tighten name and release assets

* test(ci): auto generated release notes

* fix(ci): remove commit hash from asset name for determinism

* test(ci): start tag should be last release
This commit is contained in:
Aaryamann Challani 2022-11-16 20:06:17 +05:30 committed by GitHub
parent 3d943bccb6
commit 25bcb7991b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 43 deletions

View File

@ -11,31 +11,26 @@ jobs:
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Declare short sha - name: Install stable toolchain
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 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: nightly toolchain: stable
override: true override: true
- name: Update git submodules - name: Update git submodules
run: git submodule update --init --recursive run: git submodule update --init --recursive
- name: cargo build - name: cargo build
run: | run: |
cargo build --release --workspace cargo build --release --workspace --exclude rln-wasm
mkdir release mkdir release
cp target/release/librln* release/ cp target/release/librln* release/
tar -czvf linux-rln-${{steps.vars.outputs.sha_short}}.tar.gz release/ tar -czvf linux-rln.tar.gz release/
- name: Upload archive artifact - name: Upload archive artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: linux-archive name: linux-archive
path: linux-rln-${{steps.vars.outputs.sha_short}}.tar.gz path: linux-rln.tar.gz
retention-days: 2 retention-days: 2
macos: macos:
@ -46,31 +41,26 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
ref: master ref: master
- name: Declare short sha - name: Install stable toolchain
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 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: nightly toolchain: stable
override: true override: true
- name: Update git submodules - name: Update git submodules
run: git submodule update --init --recursive run: git submodule update --init --recursive
- name: cargo build - name: cargo build
run: | run: |
cargo build --release --workspace cargo build --release --workspace --exclude rln-wasm
mkdir release mkdir release
cp target/release/librln* release/ cp target/release/librln* release/
tar -czvf macos-rln-${{steps.vars.outputs.sha_short}}.tar.gz release/ tar -czvf macos-rln.tar.gz release/
- name: Upload archive artifact - name: Upload archive artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: macos-archive name: macos-archive
path: macos-rln-${{steps.vars.outputs.sha_short}}.tar.gz path: macos-rln.tar.gz
retention-days: 2 retention-days: 2
browser-rln-wasm: browser-rln-wasm:
@ -87,11 +77,6 @@ jobs:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
override: true 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 - run: git submodule update --init --recursive
- name: Install wasm-pack - name: Install wasm-pack
uses: jetli/wasm-pack-action@v0.3.0 uses: jetli/wasm-pack-action@v0.3.0
@ -102,14 +87,14 @@ jobs:
cargo make build cargo make build
mkdir release mkdir release
cp pkg/** release/ cp pkg/** release/
tar -czvf browser-rln-wasm-${{steps.vars.outputs.sha_short}}.tar.gz release/ tar -czvf browser-rln-wasm.tar.gz release/
working-directory: rln-wasm working-directory: rln-wasm
- name: Upload archive artifact - name: Upload archive artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: browser-rln-wasm-archive name: browser-rln-wasm-archive
path: browser-rln-wasm-${{steps.vars.outputs.sha_short}}.tar.gz path: rln-wasm/browser-rln-wasm.tar.gz
retention-days: 2 retention-days: 2
@ -124,18 +109,6 @@ jobs:
ref: master ref: master
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v2 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 - name: Delete tag
uses: dev-drprasad/delete-tag-and-release@v0.2.0 uses: dev-drprasad/delete-tag-and-release@v0.2.0
@ -147,11 +120,14 @@ jobs:
- name: Create prerelease - name: Create prerelease
run: | run: |
start_tag=$(gh release list -L 2 --exclude-drafts | grep -v nightly | cut -d$'\t' -f3)
gh release create nightly --prerelease --target master \ gh release create nightly --prerelease --target master \
--title 'Nightly build ("master" branch)' --notes-file release_notes.md \ --title 'Nightly build ("master" branch)' \
linux-archive/* \ --generate-notes \
macos-archive/* \ --notes-start-tag $start_tag \
browser-rln-wasm-archive/* linux-archive/linux-rln.tar.gz \
macos-archive/macos-rln.tar.gz \
browser-rln-wasm-archive/browser-rln-wasm.tar.gz
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}