Skip to content

Commit f67be95

Browse files
collins-wtirumerla
andauthored
chore: publish the Rust docs to Netlify (#180)
* chore: publish rust docs to netflify * chore: add a preview link to test the techincal docs * chore: add a preview link to test the techincal docs * docs: implement redirect on technical docs link * chore: ensure that the technical docs is updated per specific release version * chore: add ability to also push to netlify release branches * chore: refactor the rust-docs-netlify update * chore: add a workflow to update tech docs link * chore: test a workflow that updates tech docs link * chore: test a workflow that updates tech docs link * chore: test a workflow that updates tech docs link * chore: test a workflow that updates tech docs link * chore: test a workflow that updates tech docs link * chore: test a workflow that updates tech docs link * chore: test a workflow that updates tech docs link * chore: clean up * chore: add netlify badge * chore: add netlify badge * chore: listen to push on docs-v* branch * chore: Fix rust docs pipelines * chore: Cargo lock update * chore: Fix yaml * fix: fix the rust-docs url workflow * chore: update the target docs url * chore: an an approval requirement on the release jobs * chore: Fix cargo lock ci and environment fixes * chore: Fix cargo lock ci and environment fixes * chore: Fix typo --------- Co-authored-by: tirumerla <[email protected]>
1 parent a5f660c commit f67be95

17 files changed

+461
-400
lines changed

.github/actions/prepare/action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
name: Cache
33
description: Caches cargo dependencies
4+
inputs:
5+
components:
6+
description: Additional Rust components to install (comma separated). rustfmt and clippy are always included.
7+
required: false
8+
default: ''
49
outputs:
510
cache-hit:
611
description: Cache Hit
@@ -12,12 +17,10 @@ runs:
1217
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
1318
with:
1419
toolchain: stable
15-
components: rustfmt, clippy
16-
20+
components: ${{ (inputs.components != '') && format('{0}, rustfmt, clippy', inputs.components) || 'rustfmt, clippy' }}
1721
- name: Install libsodium
1822
run: sudo apt-get update && sudo apt-get install -y libsodium-dev
1923
shell: bash
20-
2124
- name: Restore cargo dependencies from cache
2225
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
2326
id: cache

.github/release-please/.config.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
},
2424
{
2525
"type": "chore",
26-
"section": "⚙️ Miscellaneous Chores"
26+
"section": "⚙️ Miscellaneous Chores",
27+
"hidden": true
2728
},
2829
{
2930
"type": "docs",
3031
"section": "📚 Documentation",
31-
"hidden": false
32+
"hidden": true
3233
},
3334
{
3435
"type": "style",
@@ -53,7 +54,18 @@
5354
{
5455
"type": "ci",
5556
"section": "🥏 Continuous Integration",
56-
"hidden": false
57+
"hidden": true
58+
}
59+
],
60+
"extra-files": [
61+
{
62+
"type": "toml",
63+
"path": "Cargo.toml",
64+
"jsonpath": "package.version"
65+
},
66+
{
67+
"type": "generic",
68+
"path": "docs/antora.yml"
5769
}
5870
]
5971
}

.github/workflows/ci.yaml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
name: CI
5757
needs:
5858
- msrv
59-
- lockfile
6059
- rustfmt
6160
- clippy
6261
runs-on: ubuntu-latest
@@ -85,25 +84,6 @@ jobs:
8584
# Check the minimum supported Rust version
8685
- name: Default features
8786
run: cargo hack check --feature-powerset --locked --rust-version --all-targets
88-
lockfile:
89-
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-lockfile-files == 'true' }}
90-
needs: changed_files
91-
runs-on: ubuntu-latest
92-
steps:
93-
# Checkout the repository
94-
- name: Checkout Code
95-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
96-
- name: Prepare
97-
id: init
98-
uses: ./.github/actions/prepare
99-
100-
# Get the output of the prepare composite action
101-
- name: Get cache-hit output
102-
run: 'echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
103-
104-
# Check the lockfile
105-
- name: Validate lockfile updates
106-
run: cargo update --locked
10787
rustfmt:
10888
if: ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-rust-files == 'true' }}
10989
needs: changed_files
@@ -174,9 +154,6 @@ jobs:
174154
# Checkout the repository
175155
- name: Checkout Code
176156
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
177-
- name: Get disk space
178-
run: df -h
179-
continue-on-error: true
180157
- name: free disk space
181158
run: |
182159
sudo swapoff -a
@@ -188,20 +165,15 @@ jobs:
188165
else
189166
echo "No Docker images found to remove"
190167
fi
191-
df -h
192168
- name: Prepare
193169
id: init
194170
uses: ./.github/actions/prepare
171+
with:
172+
components: llvm-tools-preview
195173

196174
# Get the output of the prepare composite action
197175
- name: Get cache-hit output
198176
run: 'echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
199-
- name: Setup Rust
200-
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
201-
with:
202-
toolchain: stable
203-
components: llvm-tools-preview
204-
rustflags: ''
205177
- name: Install cargo hack
206178
uses: taiki-e/install-action@cargo-hack
207179
- name: Install cargo-llvm-cov

.github/workflows/rc.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
---
22
name: RC for Major/Minor Releases
3-
43
on:
54
workflow_dispatch:
65
inputs:
76
commit_sha:
87
description: Long form commit SHA to create release branch from
98
required: true
109
type: string
11-
1210
permissions:
1311
contents: write
1412
pull-requests: write
15-
16-
1713
# run concurrency group for the workflow
1814
concurrency:
1915
group: ${{ github.workflow }}-${{ github.ref }}
2016
cancel-in-progress: false
21-
2217
jobs:
2318
create-release-branch:
2419
runs-on: ubuntu-latest
@@ -28,7 +23,6 @@ jobs:
2823
with:
2924
app-id: ${{ vars.GH_APP_ID }}
3025
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
31-
3226
- name: Validate Commit SHA
3327
run: |
3428
if [[ ! "$INPUT_COMMIT_SHA" =~ ^[0-9a-f]{40}$ ]]; then
@@ -40,33 +34,34 @@ jobs:
4034
echo "Valid commit SHA: $INPUT_COMMIT_SHA"
4135
env:
4236
INPUT_COMMIT_SHA: ${{ github.event.inputs.commit_sha }}
43-
4437
- name: Checkout repository at commit SHA
4538
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4639
with:
4740
ref: ${{ github.event.inputs.commit_sha }}
4841
fetch-depth: 0
4942
token: ${{ steps.gh-app-token.outputs.token }}
50-
5143
- name: Get version from Cargo.toml
5244
id: get_version
5345
run: |
54-
# Extract the version from Cargo.toml
55-
version=$(grep -A 5 "\[package\]" Cargo.toml | grep "^version" | cut -d'"' -f2)
46+
# Extract the version from manifest.json
47+
version=$(jq -r '.[ "."]' .github/release-please/manifest.json)
5648
if [ -z "$version" ]; then
57-
echo "Version not found in Cargo.toml" >&2
49+
echo "Error: Version not found in manifest.json"
5850
exit 1
5951
fi
60-
echo "Version is $version"
61-
echo "version=$version" >> $GITHUB_OUTPUT
62-
52+
echo "Version found: $version"
53+
# Get current version
54+
IFS='.' read -r major minor patch <<< "$version"
55+
new_minor=$((minor + 1))
56+
new_version="${major}.${new_minor}.0"
57+
echo "New version: $new_version"
58+
echo "version=$new_version" >> $GITHUB_OUTPUT
6359
- name: Set release branch name
6460
id: set_branch
6561
run: |
6662
branch="release-v${{ steps.get_version.outputs.version }}"
6763
echo "release_branch=$branch" >> $GITHUB_ENV
6864
echo "Release branch will be: $branch"
69-
7065
- name: Check if release branch exists
7166
id: check_branch
7267
run: |
@@ -76,13 +71,13 @@ jobs:
7671
else
7772
echo "exists=false" >> $GITHUB_OUTPUT
7873
fi
79-
8074
- name: Create release branch
8175
id: update_branch
8276
shell: bash
8377
run: |-
8478
branch="release-v${{ steps.get_version.outputs.version }}"
8579
commit_sha="${{ github.event.inputs.commit_sha }}"
80+
echo "branch=$branch" >> $GITHUB_OUTPUT
8681
if [ "${{ steps.check_branch.outputs.exists }}" == "true" ]; then
8782
echo "Branch '$branch' already exists. Exiting with error."
8883
exit 1

.github/workflows/release-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
build-push-image:
1212
name: Build and Push Docker Image
1313
runs-on: ubuntu-latest
14+
environment: release
1415
env:
1516
DOCKERHUB_IMAGE: openzeppelin/openzeppelin-relayer
1617
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/release-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
docs:
1717
name: publish docs
1818
runs-on: ubuntu-latest
19+
environment: release
1920
env:
2021
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
2122
SLACK_CHANNEL: '#oss-releases'
@@ -56,6 +57,8 @@ jobs:
5657
DOCS_BRANCH="docs-v${MAJOR}.${MINOR}"
5758
echo "DOCS_BRANCH=${DOCS_BRANCH}" >> $GITHUB_OUTPUT
5859
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" >> $GITHUB_OUTPUT
60+
echo "MAJOR=${MAJOR}" >> $GITHUB_OUTPUT
61+
echo "MINOR=${MINOR}" >> $GITHUB_OUTPUT
5962
if [ "$PATCH" -ne 0 ]; then
6063
# If it's a patch version, create a PR to merge release branch into docs branch
6164
echo "Creating PR to merge ${RELEASE_BRANCH} into ${DOCS_BRANCH}"

0 commit comments

Comments
 (0)