Skip to content

Commit

Permalink
Merge pull request #44 from UnownHash/feat-release-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
na-ji authored Nov 29, 2024
2 parents 51a9fdc + 4c3e647 commit 7592a40
Show file tree
Hide file tree
Showing 13 changed files with 1,523 additions and 25 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.13.1
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.15.0
with:
parallel-commands: |
npx nx affected --target=lint --parallel=3
Expand All @@ -24,7 +24,7 @@ jobs:
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.13.1
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.15.0
with:
number-of-agents: 2

Expand All @@ -39,9 +39,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand All @@ -54,7 +54,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
push:
branches:
- main

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm clean-install
- name: 'Setup git'
run: |
git config --global user.email "[email protected]"
git config --global user.name "Release bot"
- name: 'Release app'
run: npx nx release --skip-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "${1}"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged --verbose
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
FROM node:22 AS build-env

COPY package.json package-lock.json /app/
WORKDIR /app

RUN npm ci --no-save
ENV HUSKY=0

RUN npm ci
COPY . /app
ENV NODE_ENV=production
RUN npm run build
# re-install without dev dependencies
RUN npm ci --omit=dev

FROM gcr.io/distroless/nodejs22-debian12

COPY --from=build-env /app /rotom
WORKDIR /rotom
CMD ["dist/packages/server/main.js"]
12 changes: 12 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,17 @@
"nxCloudAccessToken": "YzIxM2YxMDYtYTUzYi00MmI3LTg0YzAtMWI1NTNmNDVlODdmfHJlYWQtd3JpdGU=",
"useInferencePlugins": false,
"defaultBase": "main",
"release": {
"projectsRelationship": "fixed",
"projects": ["packages/*"],
"version": {
"conventionalCommits": true
},
"changelog": {
"workspaceChangelog": {
"createRelease": "github"
}
}
},
"useLegacyCache": true
}
Loading

0 comments on commit 7592a40

Please sign in to comment.