Skip to content

chore: publish the Rust docs to Netlify #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
90bef20
chore: publish rust docs to netflify
collins-w Apr 28, 2025
85c6baa
chore: add a preview link to test the techincal docs
collins-w Apr 28, 2025
f9d4946
chore: add a preview link to test the techincal docs
collins-w Apr 28, 2025
009d3ea
docs: implement redirect on technical docs link
collins-w Apr 29, 2025
8d29836
chore: ensure that the technical docs is updated per specific release…
collins-w May 2, 2025
9bd8d5c
Merge branch 'update-antora-docs' of github.com:OpenZeppelin/openzepp…
collins-w May 2, 2025
ea5302a
chore: add ability to also push to netlify release branches
collins-w May 2, 2025
2147ef1
chore: refactor the rust-docs-netlify update
collins-w May 2, 2025
ab4512d
chore: add a workflow to update tech docs link
collins-w May 5, 2025
017a97a
chore: test a workflow that updates tech docs link
collins-w May 5, 2025
762580a
chore: test a workflow that updates tech docs link
collins-w May 5, 2025
9638bf9
chore: test a workflow that updates tech docs link
collins-w May 5, 2025
9336838
chore: test a workflow that updates tech docs link
collins-w May 5, 2025
d0ab4e1
chore: test a workflow that updates tech docs link
collins-w May 5, 2025
fc29111
chore: test a workflow that updates tech docs link
collins-w May 5, 2025
f445b5e
chore: test a workflow that updates tech docs link
collins-w May 5, 2025
33b5ca0
chore: clean up
collins-w May 5, 2025
0140010
chore: add netlify badge
collins-w May 5, 2025
8407872
chore: add netlify badge
collins-w May 5, 2025
36977aa
chore: listen to push on docs-v* branch
collins-w May 5, 2025
e96558e
chore: Fix rust docs pipelines
tirumerla May 6, 2025
a8d162c
chore: Cargo lock update
tirumerla May 6, 2025
52b53e1
chore: Merge branch 'main' into rust-docs
tirumerla May 6, 2025
45bc8ca
chore: Fix yaml
tirumerla May 6, 2025
810c9f4
fix: fix the rust-docs url workflow
collins-w May 7, 2025
201b64c
chore: update the target docs url
collins-w May 7, 2025
3337473
chore: an an approval requirement on the release jobs
collins-w May 12, 2025
ad796ed
chore: Fix cargo lock ci and environment fixes
tirumerla May 13, 2025
b194524
chore: Fix cargo lock ci and environment fixes
tirumerla May 13, 2025
7dd9740
chore: Fix typo
tirumerla May 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
name: Cache
description: Caches cargo dependencies
inputs:
components:
description: Additional Rust components to install (comma separated). rustfmt and clippy are always included.
required: false
default: ''
outputs:
cache-hit:
description: Cache Hit
Expand All @@ -12,12 +17,10 @@ runs:
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
with:
toolchain: stable
components: rustfmt, clippy

components: ${{ (inputs.components != '') && format('{0}, rustfmt, clippy', inputs.components) || 'rustfmt, clippy' }}
- name: Install libsodium
run: sudo apt-get update && sudo apt-get install -y libsodium-dev
shell: bash

- name: Restore cargo dependencies from cache
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
id: cache
18 changes: 15 additions & 3 deletions .github/release-please/.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
},
{
"type": "chore",
"section": "⚙️ Miscellaneous Chores"
"section": "⚙️ Miscellaneous Chores",
"hidden": true
},
{
"type": "docs",
"section": "📚 Documentation",
"hidden": false
"hidden": true
},
{
"type": "style",
Expand All @@ -53,7 +54,18 @@
{
"type": "ci",
"section": "🥏 Continuous Integration",
"hidden": false
"hidden": true
}
],
"extra-files": [
{
"type": "toml",
"path": "Cargo.toml",
"jsonpath": "package.version"
},
{
"type": "generic",
"path": "docs/antora.yml"
}
]
}
32 changes: 2 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
name: CI
needs:
- msrv
- lockfile
- rustfmt
- clippy
runs-on: ubuntu-latest
Expand Down Expand Up @@ -85,25 +84,6 @@ jobs:
# Check the minimum supported Rust version
- name: Default features
run: cargo hack check --feature-powerset --locked --rust-version --all-targets
lockfile:
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-lockfile-files == 'true' }}
needs: changed_files
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Prepare
id: init
uses: ./.github/actions/prepare

# Get the output of the prepare composite action
- name: Get cache-hit output
run: 'echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'

# Check the lockfile
- name: Validate lockfile updates
run: cargo update --locked
rustfmt:
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-rust-files == 'true' }}
needs: changed_files
Expand Down Expand Up @@ -174,9 +154,6 @@ jobs:
# Checkout the repository
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get disk space
run: df -h
continue-on-error: true
- name: free disk space
run: |
sudo swapoff -a
Expand All @@ -188,20 +165,15 @@ jobs:
else
echo "No Docker images found to remove"
fi
df -h
- name: Prepare
id: init
uses: ./.github/actions/prepare
with:
components: llvm-tools-preview

# Get the output of the prepare composite action
- name: Get cache-hit output
run: 'echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
with:
toolchain: stable
components: llvm-tools-preview
rustflags: ''
- name: Install cargo hack
uses: taiki-e/install-action@cargo-hack
- name: Install cargo-llvm-cov
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
---
name: RC for Major/Minor Releases

on:
workflow_dispatch:
inputs:
commit_sha:
description: Long form commit SHA to create release branch from
required: true
type: string

permissions:
contents: write
pull-requests: write


# run concurrency group for the workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
create-release-branch:
runs-on: ubuntu-latest
Expand All @@ -28,7 +23,6 @@ jobs:
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Validate Commit SHA
run: |
if [[ ! "$INPUT_COMMIT_SHA" =~ ^[0-9a-f]{40}$ ]]; then
Expand All @@ -40,33 +34,34 @@ jobs:
echo "Valid commit SHA: $INPUT_COMMIT_SHA"
env:
INPUT_COMMIT_SHA: ${{ github.event.inputs.commit_sha }}

- name: Checkout repository at commit SHA
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.commit_sha }}
fetch-depth: 0
token: ${{ steps.gh-app-token.outputs.token }}

- name: Get version from Cargo.toml
id: get_version
run: |
# Extract the version from Cargo.toml
version=$(grep -A 5 "\[package\]" Cargo.toml | grep "^version" | cut -d'"' -f2)
# Extract the version from manifest.json
version=$(jq -r '.[ "."]' .github/release-please/manifest.json)
if [ -z "$version" ]; then
echo "Version not found in Cargo.toml" >&2
echo "Error: Version not found in manifest.json"
exit 1
fi
echo "Version is $version"
echo "version=$version" >> $GITHUB_OUTPUT

echo "Version found: $version"
# Get current version
IFS='.' read -r major minor patch <<< "$version"
new_minor=$((minor + 1))
new_version="${major}.${new_minor}.0"
echo "New version: $new_version"
echo "version=$new_version" >> $GITHUB_OUTPUT
- name: Set release branch name
id: set_branch
run: |
branch="release-v${{ steps.get_version.outputs.version }}"
echo "release_branch=$branch" >> $GITHUB_ENV
echo "Release branch will be: $branch"

- name: Check if release branch exists
id: check_branch
run: |
Expand All @@ -76,13 +71,13 @@ jobs:
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Create release branch
id: update_branch
shell: bash
run: |-
branch="release-v${{ steps.get_version.outputs.version }}"
commit_sha="${{ github.event.inputs.commit_sha }}"
echo "branch=$branch" >> $GITHUB_OUTPUT
if [ "${{ steps.check_branch.outputs.exists }}" == "true" ]; then
echo "Branch '$branch' already exists. Exiting with error."
exit 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
build-push-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
environment: release
env:
DOCKERHUB_IMAGE: openzeppelin/openzeppelin-relayer
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
docs:
name: publish docs
runs-on: ubuntu-latest
environment: release
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL: '#oss-releases'
Expand Down Expand Up @@ -56,6 +57,8 @@ jobs:
DOCS_BRANCH="docs-v${MAJOR}.${MINOR}"
echo "DOCS_BRANCH=${DOCS_BRANCH}" >> $GITHUB_OUTPUT
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" >> $GITHUB_OUTPUT
echo "MAJOR=${MAJOR}" >> $GITHUB_OUTPUT
echo "MINOR=${MINOR}" >> $GITHUB_OUTPUT
if [ "$PATCH" -ne 0 ]; then
# If it's a patch version, create a PR to merge release branch into docs branch
echo "Creating PR to merge ${RELEASE_BRANCH} into ${DOCS_BRANCH}"
Expand Down
Loading