Skip to content

Near Crates Publish #30

Near Crates Publish

Near Crates Publish #30

name: Near Crates Publish
on:
workflow_dispatch:
inputs:
branch:
type: string
required: true
description: Branch name or tag to publish crates from
jobs:
publish-cargo-crates:
name: "Publish near-workspaces on crates.io https://crates.io/crates/near-workspaces"
runs-on: "ubuntu-22.04-16core"
environment: deploy
permissions:
contents: write # required for crates push
timeout-minutes: 30
steps:
- name: Checkout near/nearcore's ${{ github.event.inputs.branch }} branch
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Set up git user
uses: fregante/setup-git-user@v2
- name: Publish near-workspaces on crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
set -x
cargo install --git https://github.com/miraclx/cargo-workspaces --tag v0.3.0 cargo-workspaces
cargo ws publish --yes --allow-dirty --force '*' \
--no-git-commit --no-git-push --no-individual-tags --tag-prefix 'crates-' \
--tag-msg $$'crates.io snapshot\n---%{\n- %n - https://crates.io/crates/%n/%v}'
- name: Create tag on https://github.com/near/nearcore
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push --no-follow-tags https://github.com/near/nearcore.git tag 'crates-*'