Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 61 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
name: Build
on: [push]

env:
CI_BUILD_NUM: ${{ github.run_id }}
CI_BRANCH: ${{ github.ref_name }}

permissions:
contents: write # semantic-release-dry verifies the write permissions
issues: read # needed by semantic-release
pull-requests: write # needed by semantic-release

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js ${{ matrix.node-version }}
- name: Set up Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
node-version: '24.x'

- name: Install dependencies
run: npm ci
Expand All @@ -33,15 +39,59 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info

release:
name: Deploy
test-deploy:
name: Test Deploy
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
needs: test
steps:
- uses: actions/checkout@v5
- name: Use Node.js 24.x
uses: actions/setup-node@v5
with:
node-version: '24.x'
- name: extracting last commit message
run: |
echo "CI_LAST_COMMIT_MSG=$(git show -s --format="%s")" >> $GITHUB_ENV
echo CI_LAST_COMMIT_MSG
- name: Install dependencies
run: npm ci
- name: Branch Deployment
run: npm run deploy:ci
env:
CLOUDFLARE_API_TOKEN: ${{secrets.CLOUDFLARE_API_TOKEN}}
CLOUDFLARE_ACCOUNT_ID: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}

- name: Post-Deployment Integration Test
run: npm run test:postdeploy
- name: Semantic Release (Dry Run)
run: npm run semantic-release-dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_TOKEN: ${{secrets.SLACK_TOKEN}}

release:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: test
steps:
- uses: actions/checkout@v5
- name: Deploy
uses: cloudflare/wrangler-action@v3
- name: Use Node.js 24.x
uses: actions/setup-node@v5
with:
apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}}
accountId: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
node-version: '24.x'
- name: extracting last commit message
run: |
echo "CI_LAST_COMMIT_MSG=$(git show -s --format="%s")" >> $GITHUB_ENV
echo CI_LAST_COMMIT_MSG
- name: Install dependencies
run: npm ci
- name: Semantic Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{secrets.CLOUDFLARE_API_TOKEN}}
CLOUDFLARE_ACCOUNT_ID: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
SLACK_TOKEN: ${{secrets.SLACK_TOKEN}}

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
30 changes: 30 additions & 0 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
['@semantic-release/changelog', {
changelogFile: 'CHANGELOG.md',
}],
["@semantic-release/npm", {
npmPublish: false,
}],
['@semantic-release/git', {
assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}],
['@semantic-release/exec', {
prepareCmd: 'npm run deploy:ci && npm run test:postdeploy',
publishCmd: 'npm run deploy:stage',
successCmd: 'echo "${nextRelease.version}" > released.txt',
}],
'@semantic-release/github',
["semantic-release-slack-bot", {
notifyOnSuccess: true,
notifyOnFail: true,
markdownReleaseNotes: true,
slackChannel: "helix-escalations",
}
]
],
branches: ['main'],
};
Loading