Skip to content

chore(release): sn_cli-v0.83.19/sn_client-v0.92.0/sn_registers-v0.3.0… #97

chore(release): sn_cli-v0.83.19/sn_client-v0.92.0/sn_registers-v0.3.0…

chore(release): sn_cli-v0.83.19/sn_client-v0.92.0/sn_registers-v0.3.0… #97

Workflow file for this run

name: release
on:
push:
branches:
- main
env:
RELEASE_PLZ_BIN_URL: https://github.com/MarcoIeni/release-plz/releases/download/release-plz-v0.3.11/release-plz-x86_64-unknown-linux-gnu.tar.gz
JUST_BIN_URL: https://github.com/casey/just/releases/download/1.13.0/just-1.13.0-x86_64-unknown-linux-musl.tar.gz
WORKFLOW_URL: https://github.com/maidsafe/safe_network/actions/runs
jobs:
build:
if: |
github.repository_owner == 'maidsafe' &&
startsWith(github.event.head_commit.message, 'chore(release):')
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: arm-unknown-linux-musleabi
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# It's quite slow to install just by building it, but here we need a cross-platform solution.
- shell: bash
run: cargo install just
- shell: bash
run: just build-release-artifacts "${{ matrix.target }}"
- uses: actions/upload-artifact@main
with:
name: safe_network-${{ matrix.target }}
path: |
artifacts
!artifacts/.cargo-lock
- name: post notification to slack on failure
if: ${{ failure() }}
uses: bryannice/[email protected]
env:
SLACK_INCOMING_WEBHOOK: ${{ secrets.SLACK_GH_ACTIONS_WEBHOOK_URL }}
SLACK_MESSAGE: "Please check the logs for the run at ${{ env.WORKFLOW_URL }}/${{ github.run_id }}"
SLACK_TITLE: "Release Failed"
release:
if: |
github.repository_owner == 'maidsafe' &&
startsWith(github.event.head_commit.message, 'chore(release):')
name: publish and release
runs-on: ubuntu-latest
needs: [build]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DEPLOY_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DEPLOY_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-2
GH_TOKEN: ${{ secrets.VERSION_BUMP_COMMIT_PAT }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "0"
token: ${{ secrets.VERSION_BUMP_COMMIT_PAT }}
- uses: actions/download-artifact@master
with:
name: safe_network-x86_64-pc-windows-msvc
path: artifacts/x86_64-pc-windows-msvc/release
- uses: actions/download-artifact@master
with:
name: safe_network-x86_64-unknown-linux-musl
path: artifacts/x86_64-unknown-linux-musl/release
- uses: actions/download-artifact@master
with:
name: safe_network-x86_64-apple-darwin
path: artifacts/x86_64-apple-darwin/release
- uses: actions/download-artifact@master
with:
name: safe_network-arm-unknown-linux-musleabi
path: artifacts/arm-unknown-linux-musleabi/release
- uses: actions/download-artifact@master
with:
name: safe_network-armv7-unknown-linux-musleabihf
path: artifacts/armv7-unknown-linux-musleabihf/release
- uses: actions/download-artifact@master
with:
name: safe_network-aarch64-unknown-linux-musl
path: artifacts/aarch64-unknown-linux-musl/release
- shell: bash
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
# It's possible to `cargo install` these tools, but it's very slow to compile on GHA infra.
# Therefore we just pull some binaries from the Github Releases.
- name: install tools
shell: bash
run: |
curl -L -O $RELEASE_PLZ_BIN_URL
tar xvf release-plz-x86_64-unknown-linux-gnu.tar.gz
rm release-plz-x86_64-unknown-linux-gnu.tar.gz
sudo mv release-plz /usr/local/bin
curl -L -O $JUST_BIN_URL
mkdir just
tar xvf just-1.13.0-x86_64-unknown-linux-musl.tar.gz -C just
rm just-1.13.0-x86_64-unknown-linux-musl.tar.gz
sudo mv just/just /usr/local/bin
rm -rf just
- name: publish and release
shell: bash
run: |
cargo login ${{ secrets.CRATES_IO_TOKEN }}
release-plz release --git-token ${{ secrets.VERSION_BUMP_COMMIT_PAT }}
just package-release-assets "safe"
just package-release-assets "safenode"
just package-release-assets "testnet"
# The versioned assets are uploaded to both the release and S3 in this target.
just upload-release-assets
# Now repackage and upload the artifacts to S3 using 'latest' for the version.
just package-release-assets "safe" "latest"
just package-release-assets "safenode" "latest"
just package-release-assets "testnet" "latest"
just upload-release-assets-to-s3 "safe"
just upload-release-assets-to-s3 "safenode"
just upload-release-assets-to-s3 "testnet"
- name: post notification to slack on failure
if: ${{ failure() }}
uses: bryannice/[email protected]
env:
SLACK_INCOMING_WEBHOOK: ${{ secrets.SLACK_GH_ACTIONS_WEBHOOK_URL }}
SLACK_MESSAGE: "Please check the logs for the run at ${{ env.WORKFLOW_URL }}/${{ github.run_id }}"
SLACK_TITLE: "Release Failed"