-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbcc6e6
commit 7b1d7ac
Showing
2 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Release Versions or Publish NPM | ||
name: Update Release PR or Release Versions and Publish | ||
|
||
on: | ||
push: | ||
|
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,100 @@ | ||
name: Release Versions and Publish NPM | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
# This is for .npmrc. Nx automatically creates an .npmrc before changesets runs | ||
# and creates one itself, so we need to explicitly have one. | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
concurrency: commits-to-main | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout all commits | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup | ||
uses: ./.github/actions/setup-all | ||
with: | ||
node_version: 20.10.0 | ||
go_version: 1.23.0 | ||
# The SDK is referenced via dist in the tsconfig.base.json | ||
# because the next executor does not actually support | ||
# buildLibsFromSource=false | ||
# With this configuration NX does not build the SDK as expected | ||
# when it is an app dependency | ||
- name: Force build SDK | ||
shell: bash | ||
run: npx nx run sdk:build | ||
- name: Build for publishing | ||
shell: bash | ||
run: npx nx run-many --target=build --configuration=production --all --parallel=5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | ||
CCRI_TOKEN: ${{ secrets.CCRI_TOKEN }} | ||
- name: Replace src code with dists for publishing | ||
run: ./scripts/replace-src-with-dists-for-publishing.sh | ||
# If no changesets were detected in the PR prep step then we are in | ||
# release/publish mode. Check for and publish any new versions to NPM. | ||
- name: Publish to NPM and create GitHub releases | ||
id: changesets_release | ||
uses: changesets/action@v1 | ||
with: | ||
publish: npm run release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Release Go modules | ||
# if a release was published, release the Go modules | ||
if: steps.changesets_release.outputs.published == 'true' | ||
uses: peter-evans/repository-dispatch@v3 | ||
with: | ||
token: ${{ secrets.PAT_REPOSITORY_DISPATCH }} | ||
repository: siafoundation/web | ||
event-type: release-go | ||
release-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout all commits | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup | ||
uses: ./.github/actions/setup-all | ||
with: | ||
node_version: 20.10.0 | ||
go_version: 1.23.0 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
# The SDK is referenced via dist in the tsconfig.base.json | ||
# because the next executor does not actually support | ||
# buildLibsFromSource=false | ||
# With this configuration NX does not build the SDK as expected | ||
# when it is an app dependency | ||
- name: Force build SDK | ||
shell: bash | ||
run: npx nx run sdk:build | ||
- name: Containers | ||
shell: bash | ||
run: npx nx run-many --target=container --configuration=production -all --parallel=5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | ||
CCRI_TOKEN: ${{ secrets.CCRI_TOKEN }} | ||
- name: Containers zen | ||
shell: bash | ||
run: npx nx run-many --target=container --configuration=production-testnet-zen -all --parallel=5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} | ||
CCRI_TOKEN: ${{ secrets.CCRI_TOKEN }} |