-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Unify workflows * fix formatting * Use bigger node * Add docs to pipeline * Comment if * Change ignore parameters * Removing fetch * Fetching history * Adding new branch * Update docs before merge * Restore code * Create gh-pages --------- Co-authored-by: ausias-armesto <[email protected]>
- Loading branch information
1 parent
52200be
commit 29e93ee
Showing
22 changed files
with
4,587 additions
and
196 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# GitHub Workflows | ||
|
||
This document describes the GitHub workflows used in this project. | ||
|
||
## Build | ||
|
||
Builds, Lint, Test and publish every commit on a pull request | ||
|
||
The published artifact will have the version x.y.z-pr.<PR_NUMBER>+<BUILD_DATE> | ||
The artifact will be published as well in the release channel `next` so it can be used as `@hoprnet/hopr-sdk@next` | ||
|
||
## Merge PR | ||
|
||
Exclusively publish the closure of a pull request in the alpha release channel so it can be used as `@hoprnet/hopr-sdk@alpha` | ||
|
||
The published artifact will have the version x.y.z-pr.<PR_NUMBER> | ||
|
||
## Close release | ||
|
||
This is a workflow triggered manually from Github Actions [Close Release](https://github.com/hoprnet/hopr-sdk/actions/workflows/release.yaml). The tasks performed by this workflow include: | ||
|
||
- Publish the version in the latest release channel so it can be used as `@hoprnet/hopr-sdk@latest` | ||
- Publish the artifact with version x.y.z | ||
- Published in the internal Google Artifact Registry and in public NPM registry | ||
- Create a Github release | ||
- Tag code | ||
- Add a changelog to the Github release with the list of PR merged during this release | ||
- Bumps the new version by opening a new PR | ||
- Sends a Zulip notification |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize, opened, reopened] | ||
|
||
concurrency: | ||
group: build | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: self-hosted-hoprnet-big | ||
strategy: | ||
matrix: | ||
node-version: [20.x, 22.x] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: hoprnet/hopr-workflows/actions/setup-node-js@master | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Building | ||
run: yarn build | ||
|
||
- name: Linting | ||
run: yarn lint:ci | ||
|
||
- name: Formatting | ||
run: yarn format:ci | ||
|
||
- name: Testing | ||
run: yarn test | ||
|
||
publish: | ||
name: Publish | ||
runs-on: self-hosted-hoprnet-small | ||
needs: build | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: hoprnet/hopr-workflows/actions/setup-node-js@master | ||
with: | ||
node-version: ${{ vars.NODE_VERSION }} | ||
|
||
- name: Setup GCP | ||
id: gcp | ||
uses: hoprnet/hopr-workflows/actions/setup-gcp@master | ||
with: | ||
google-credentials: ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }} | ||
login-artifact-registry: 'true' | ||
|
||
- name: Publish next version | ||
run: | | ||
BUILD_DATE=$(date +%Y%m%d%H%M%S) | ||
PR_VERSION=$(jq -r '.version' package.json)-pr.${{ github.event.pull_request.number }} | ||
jq --arg version "${PR_VERSION}-${BUILD_DATE}" '.version = $version' package.json > temp.json | ||
mv temp.json package.json | ||
yarn publish --no-git-tag-version --tag next | ||
env: | ||
NODE_AUTH_TOKEN: ${{ steps.gcp.outputs.access_token }} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Merge PR | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize] | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: docs | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
merge: | ||
name: Merge PR | ||
runs-on: self-hosted-hoprnet-small | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: hoprnet/hopr-workflows/actions/setup-node-js@master | ||
with: | ||
node-version: ${{ vars.NODE_VERSION }} | ||
|
||
- name: Create docs | ||
run: | | ||
rm -rf docs/* | ||
yarn docs | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_branch: gh-pages | ||
publish_dir: docs | ||
cname: hoprnet.org | ||
force_orphan: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Merge PR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: merge | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
merge: | ||
name: Merge PR | ||
runs-on: self-hosted-hoprnet-small | ||
if: github.event.pull_request.merged == true | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: hoprnet/hopr-workflows/actions/setup-node-js@master | ||
with: | ||
node-version: ${{ vars.NODE_VERSION }} | ||
|
||
- name: Setup GCP | ||
id: gcp | ||
uses: hoprnet/hopr-workflows/actions/setup-gcp@master | ||
with: | ||
google-credentials: ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }} | ||
login-artifact-registry: 'true' | ||
|
||
- name: Unpublish PR commit versions | ||
run: | | ||
gcloud artifacts versions list --repository=npm --location=europe-west3 --project=hoprassociation --package="${{ vars.NPM_PACKAGE_NAME }}" --format=json 2> /dev/null | jq -r ' .[] | select(.name | contains("-pr.${{ github.event.pull_request.number }}-")).name' | sed 's/.*versions\///g' > pr_commit_versions.txt | ||
while read -r version; do | ||
echo "Unpublishing commit version: $version" | ||
gcloud artifacts versions delete --delete-tags --quiet --repository=npm --location=europe-west3 --project=hoprassociation --package "${{ vars.NPM_PACKAGE_NAME }}" $version | ||
done < pr_commit_versions.txt | ||
- name: Publish alpha version | ||
run: | | ||
BUILD_DATE=$(date +%Y%m%d%H%M%S) | ||
PR_VERSION=$(jq -r '.version' package.json)-pr.${{ github.event.pull_request.number }} | ||
jq --arg version "${PR_VERSION}-${BUILD_DATE}" '.version = $version' package.json > temp.json | ||
mv temp.json package.json | ||
yarn publish --no-git-tag-version --tag next | ||
jq --arg version "${PR_VERSION}" '.version = $version' package.json > temp.json | ||
mv temp.json package.json | ||
yarn publish --no-git-tag-version --tag alpha | ||
env: | ||
NODE_AUTH_TOKEN: ${{ steps.gcp.outputs.access_token }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.