Skip to content

Commit

Permalink
ci: add manual release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 18, 2024
1 parent cbcc6e6 commit 7b1d7ac
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release-main.yml
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:
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/release-manual.yml
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 }}

0 comments on commit 7b1d7ac

Please sign in to comment.