-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: migrate release process to NX (#1120)
- Loading branch information
Showing
32 changed files
with
519 additions
and
3,709 deletions.
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
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
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: 'Deploy Pre-Release' | ||
|
||
on: | ||
push: | ||
paths: | ||
- packages/elements/** | ||
- packages/elements-angular/** | ||
- packages/elements-react/** | ||
- packages/elements-vue/** | ||
|
||
jobs: | ||
canary-release: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Track master branch to make nx affected work | ||
run: | | ||
git branch --track main origin/master | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
registry-url: https://registry.npmjs.org | ||
scope: '@inovex.de' # important for yarn | ||
always-auth: true | ||
- uses: ./.github/workflows/dependencies-install | ||
- name: Setup Git | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.actor}}@users.noreply.github.com" | ||
- name: Build libs | ||
run: yarn run nx run-many -t build -p elements,elements-angular,elements-react,elements-vue | ||
- name: Version | ||
shell: bash | ||
run: yarn nx run workspace:version --configuration=prerelease | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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,36 @@ | ||
name: 'Deploy Release' | ||
|
||
on: | ||
- workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Track master branch to make nx affected work | ||
run: | | ||
git branch --track main origin/master | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
registry-url: https://registry.npmjs.org | ||
scope: '@inovex.de' # important for yarn | ||
always-auth: true | ||
- uses: ./.github/workflows/dependencies-install | ||
- name: Setup Git | ||
run: | | ||
git config --global user.name "${{ github.actor }}" | ||
git config --global user.email "${{ github.actor}}@users.noreply.github.com" | ||
- name: Build libs | ||
run: yarn run nx run-many -t build -p elements,elements-angular,elements-react,elements-vue | ||
- name: Version | ||
shell: bash | ||
run: yarn nx run workspace:version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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,54 @@ | ||
name: 'Deploy Storybook' | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/workflows/dependencies-install | ||
- run: npm config set scripts-prepend-node-path true | ||
- name: Build Storybook | ||
run: yarn nx run storybook:build | ||
- name: Upload Storybook artifact | ||
uses: ./.github/workflows/artifacts-upload | ||
with: | ||
upload-storybook-artifact: true | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout pages branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: pages | ||
- name: Download Storybook artifact | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
name: storybook | ||
path: version/${{ github.ref_name }} # Push to the proper directory on gh pages branch. | ||
check-artifacts: true # search in current workflow run | ||
workflow-conclusion: 'in_progress' # need to change to in_progress, cause current workflow run is always running | ||
- name: Provide latest symlink | ||
if: ${{ ! contains( github.ref_name, '-' ) }} # only link to latest for releases (e.g. v7.0.0), not pre-releases (e.g. v.7.0.0-1) | ||
run: cd version && rm -f latest && ln -s ${{ github.ref_name }} latest | ||
shell: bash | ||
|
||
# Crawls the version dir on current pages branch HEAD. | ||
# Jq extracts the directory name of the versions and transfers it to an array of the form ["0.1.1", "0.2.1"]. | ||
- name: Update Hosted Versions | ||
run: find ./version/* -type d -maxdepth 0 | cut -c 11- | jq -R -s -c 'split("\n")[:-1]' > ./hosted-versions.json | ||
|
||
- name: Deploy to Github Pages 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: pages | ||
commit-message: Deploying version ${{ github.ref_name }} 🚀 | ||
folder: '.' | ||
clean: false # Important to keep other versions. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.