chore(release): 0.8.0 #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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: macos-latest | |
target: aarch64-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 | |
id: toolchain | |
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: safeup-${{ matrix.target }} | |
path: | | |
artifacts | |
!artifacts/.cargo-lock | |
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.RELEASE_PAT }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" | |
token: ${{ secrets.RELEASE_PAT }} | |
- uses: actions/download-artifact@master | |
with: | |
name: safeup-x86_64-pc-windows-msvc | |
path: artifacts/x86_64-pc-windows-msvc/release | |
- uses: actions/download-artifact@master | |
with: | |
name: safeup-x86_64-unknown-linux-musl | |
path: artifacts/x86_64-unknown-linux-musl/release | |
- uses: actions/download-artifact@master | |
with: | |
name: safeup-x86_64-apple-darwin | |
path: artifacts/x86_64-apple-darwin/release | |
- uses: actions/download-artifact@master | |
with: | |
name: safeup-aarch64-apple-darwin | |
path: artifacts/aarch64-apple-darwin/release | |
- uses: actions/download-artifact@master | |
with: | |
name: safeup-arm-unknown-linux-musleabi | |
path: artifacts/arm-unknown-linux-musleabi/release | |
- uses: actions/download-artifact@master | |
with: | |
name: safeup-armv7-unknown-linux-musleabihf | |
path: artifacts/armv7-unknown-linux-musleabihf/release | |
- uses: actions/download-artifact@master | |
with: | |
name: safeup-aarch64-unknown-linux-musl | |
path: artifacts/aarch64-unknown-linux-musl/release | |
- name: configure git for 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.RELEASE_PAT }} | |
just package-release-assets | |
just upload-release-assets | |
just upload-release-assets-to-s3 |