Skip to content

Commit

Permalink
ci: release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Sep 27, 2023
1 parent 8821cd0 commit 00e8b7c
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 143 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ jobs:
pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
permissions:
packages: write
steps:
- name: Checkout all commits
uses: actions/checkout@v3
Expand All @@ -18,12 +16,6 @@ jobs:
uses: ./.github/actions/setup
with:
node_version: 19.5.0
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Commit lint
shell: bash
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -51,13 +43,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
ASSETS: ${{ github.workspace }}/assets
- name: Containers
shell: bash
run: npx nx affected --target=container --configuration=production --parallel=5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
ASSETS: ${{ github.workspace }}/assets
- name: Export
shell: bash
# issue with parallelism
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ env:
concurrency: commits-to-main

jobs:
release-npm:
release-main:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout all commits
uses: actions/checkout@v3
Expand All @@ -23,23 +25,32 @@ jobs:
uses: ./.github/actions/setup
with:
node_version: 19.5.0
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Workspace lint
shell: bash
run: npx nx workspace-lint
- name: Lint
shell: bash
run: npx nx run-many --target=lint --all --parallel=5
- name: Build
- name: Test
shell: bash
run: npx nx run-many --target=test --all --parallel=5
- name: Build for publishing
shell: bash
# configuration ci will put the dists in each project directory so changesets can publish
run: npx nx run-many --target=build --configuration=ci --all --parallel=5
# NOTE: changed from ci to production and added script for copy
run: npx nx run-many --target=build --configuration=production --all --parallel=5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
ASSETS: ${{ github.workspace }}/assets
- name: Test
shell: bash
run: npx nx run-many --target=test --all --parallel=5
- name: Release
run: ./scripts/copy-dists-for-publishing.sh
- name: Create Release Pull Request or Publish to NPM
uses: changesets/action@v1
with:
Expand All @@ -48,3 +59,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- 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 }}
ASSETS: ${{ github.workspace }}/assets
7 changes: 0 additions & 7 deletions apps/assets/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
"extractLicenses": true,
"sourceMap": false,
"externalDependencies": "none"
},
"ci": {
"outputPath": "apps/assets/dist",
"optimization": true,
"extractLicenses": true,
"sourceMap": false,
"externalDependencies": "none"
}
}
},
Expand Down
7 changes: 0 additions & 7 deletions apps/crons/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
"extractLicenses": true,
"sourceMap": false,
"externalDependencies": "none"
},
"ci": {
"outputPath": "apps/crons/dist",
"optimization": true,
"extractLicenses": true,
"sourceMap": false,
"externalDependencies": "none"
}
}
},
Expand Down
3 changes: 0 additions & 3 deletions apps/explorer/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
"with": "apps/explorer/config/testnet-zen.ts"
}
]
},
"ci": {
"outputPath": "apps/explorer/dist"
}
}
},
Expand Down
31 changes: 7 additions & 24 deletions apps/hostd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"targets": {
"build": {
"executor": "@nx/next:build",
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/hostd",
Expand All @@ -18,9 +16,6 @@
"development": {},
"production": {},
"local": {},
"ci": {
"outputPath": "apps/hostd/dist"
},
"export": {
"outputPath": "dist/apps/hostd-export",
"fileReplacements": [
Expand Down Expand Up @@ -52,9 +47,7 @@
},
"container": {
"executor": "@nx-tools/nx-container:build",
"dependsOn": [
"build"
],
"dependsOn": ["build"],
"defaultConfiguration": "local",
"options": {
"engine": "docker",
Expand All @@ -63,38 +56,28 @@
},
"configurations": {
"local": {
"tags": [
"siafoundation/web-hostd:latest"
],
"tags": ["siafoundation/web-hostd:latest"],
"push": false
},
"production": {
"tags": [
"ghcr.io/siafoundation/web-hostd:latest"
],
"tags": ["ghcr.io/siafoundation/web-hostd:latest"],
"push": true
}
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/apps/hostd"
],
"outputs": ["{workspaceRoot}/coverage/apps/hostd"],
"options": {
"jestConfig": "apps/hostd/jest.config.ts",
"passWithNoTests": true
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": [
"{options.outputFile}"
],
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/hostd/**/*.{ts,tsx,js,jsx}"
]
"lintFilePatterns": ["apps/hostd/**/*.{ts,tsx,js,jsx}"]
}
}
},
Expand Down
3 changes: 0 additions & 3 deletions apps/renterd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
"development": {},
"production": {},
"local": {},
"ci": {
"outputPath": "apps/renterd/dist"
},
"export": {
"outputPath": "dist/apps/renterd-export",
"fileReplacements": [
Expand Down
3 changes: 0 additions & 3 deletions apps/walletd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
"development": {},
"production": {},
"local": {},
"ci": {
"outputPath": "apps/walletd/dist"
},
"export": {
"outputPath": "dist/apps/walletd-export",
"fileReplacements": [
Expand Down
33 changes: 8 additions & 25 deletions apps/website/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"targets": {
"build": {
"executor": "@nx/next:build",
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/website",
Expand All @@ -23,10 +21,7 @@
},
"configurations": {
"development": {},
"production": {},
"ci": {
"outputPath": "apps/website/dist"
}
"production": {}
}
},
"serve": {
Expand All @@ -51,9 +46,7 @@
},
"container": {
"executor": "@nx-tools/nx-container:build",
"dependsOn": [
"build"
],
"dependsOn": ["build"],
"defaultConfiguration": "local",
"options": {
"engine": "docker",
Expand All @@ -62,38 +55,28 @@
},
"configurations": {
"local": {
"tags": [
"siafoundation/web-website:latest"
],
"tags": ["siafoundation/web-website:latest"],
"push": false
},
"production": {
"tags": [
"ghcr.io/siafoundation/web-website:latest"
],
"tags": ["ghcr.io/siafoundation/web-website:latest"],
"push": true
}
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/apps/website"
],
"outputs": ["{workspaceRoot}/coverage/apps/website"],
"options": {
"jestConfig": "apps/website/jest.config.ts",
"passWithNoTests": true
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": [
"{options.outputFile}"
],
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/website/**/*.{ts,tsx,js,jsx}"
]
"lintFilePatterns": ["apps/website/**/*.{ts,tsx,js,jsx}"]
}
}
},
Expand Down
6 changes: 1 addition & 5 deletions libs/design-system/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
}
]
},
"configurations": {
"ci": {
"outputPath": "libs/design-system/dist"
}
}
"configurations": {}
},
"lint": {
"executor": "@nx/linter:eslint",
Expand Down
6 changes: 1 addition & 5 deletions libs/react-core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
}
]
},
"configurations": {
"ci": {
"outputPath": "libs/react-core/dist"
}
}
"configurations": {}
},
"lint": {
"executor": "@nx/linter:eslint",
Expand Down
6 changes: 1 addition & 5 deletions libs/react-hostd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
}
]
},
"configurations": {
"ci": {
"outputPath": "libs/react-hostd/dist"
}
}
"configurations": {}
},
"lint": {
"executor": "@nx/linter:eslint",
Expand Down
6 changes: 1 addition & 5 deletions libs/react-icons/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
}
]
},
"configurations": {
"ci": {
"outputPath": "libs/react-icons/dist"
}
}
"configurations": {}
},
"lint": {
"executor": "@nx/linter:eslint",
Expand Down
6 changes: 1 addition & 5 deletions libs/react-renterd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
}
]
},
"configurations": {
"ci": {
"outputPath": "libs/react-renterd/dist"
}
}
"configurations": {}
},
"lint": {
"executor": "@nx/linter:eslint",
Expand Down
6 changes: 1 addition & 5 deletions libs/react-sia-central/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
}
]
},
"configurations": {
"ci": {
"outputPath": "libs/react-sia-central/dist"
}
}
"configurations": {}
},
"lint": {
"executor": "@nx/linter:eslint",
Expand Down
6 changes: 1 addition & 5 deletions libs/react-walletd/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
}
]
},
"configurations": {
"ci": {
"outputPath": "libs/react-walletd/dist"
}
}
"configurations": {}
},
"lint": {
"executor": "@nx/linter:eslint",
Expand Down
Loading

0 comments on commit 00e8b7c

Please sign in to comment.