Skip to content

build: Publish on tag (#64) #5

build: Publish on tag (#64)

build: Publish on tag (#64) #5

Workflow file for this run

name: Publish
on:
push:
branches:
- main
tags: ["*"]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
PROTOC_VERSION: 3.23.4
jobs:
publish:
if: github.event.repository.fork == false
name: Publish release
runs-on: ubuntu-22.04
env:
CARGO_REGISTRIES_AKKA_RS_INDEX: https://dl.cloudsmith.io/${{ secrets.CLOUDSMITH_AKKA_RS_ENTITLEMENT_TOKEN }}/lightbend/akka-rs/cargo/index.git
CARGO_REGISTRIES_AKKA_RS_TOKEN: ${{ secrets.CLOUDSMITH_LIGHTBEND_MACHINE_API_KEY }}
strategy:
fail-fast: false
matrix:
PACKAGE: ["akka-persistence-rs", "akka-persistence-rs-commitlog", "akka-projection-rs", "akka-projection-rs-commitlog", "akka-projection-rs-grpc", "akka-projection-rs-storage"]
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Update Rust
run: |
rustup update
- name: Install protoc
# https://github.com/taiki-e/install-action/releases
# v2.20.3
uses: taiki-e/install-action@47d27149ff6b3422864ec504071d5cc7873d642e
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: Cache Rust
# https://github.com/Swatinem/rust-cache/releases
# v2.7.0
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43
- name: Publish ${{ matrix.PACKAGE }}
if: startsWith(github.event.ref, 'refs/tags/v')
run: cargo publish --registry AKKA_RS -p ${{ matrix.PACKAGE }}
documentation:
if: github.event.repository.fork == false
name: Documentation
# the release environment provides access to secrets required in the release process
# https://github.com/akka/akka-edge-rs/settings/environments
environment: release
runs-on: ubuntu-22.04
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Update Rust
run: |
rustup update
- name: Install protoc
# https://github.com/taiki-e/install-action/releases
# v2.20.3
uses: taiki-e/install-action@47d27149ff6b3422864ec504071d5cc7873d642e
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: Cache Rust
# https://github.com/Swatinem/rust-cache/releases
# v2.7.0
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43
- name: Create API documentation
run: cargo doc --no-deps
- name: Key setup
env:
GUSTAV_KEY: ${{ secrets.GUSTAV_KEY }}
run: |+
eval "$(ssh-agent -s)"
echo $GUSTAV_KEY | base64 -di > .github/id_ed2551
chmod 600 .github/id_ed2551
ssh-add .github/id_ed2551
- name: Publish API documentation (tag)
if: startsWith(github.event.ref, 'refs/tags/v')
env:
TAG: ${{ github.event.ref }}
run: |+
cd target/doc
rsync -r . akkarepo@gustav.akka.io:www/api/akka-edge-rs/${TAG}/
- name: Publish API documentation (snapshot)
if: ${{ ! startsWith(github.event.ref, 'refs/tags/') }}
run: |+
cd target/doc
rsync -r . akkarepo@gustav.akka.io:www/api/akka-edge-rs/snapshot/