-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: run unit tests and generate proper releases
- Loading branch information
1 parent
ae23643
commit 336938c
Showing
3 changed files
with
90 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
name: Release | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: production | ||
url: https://github.com/marketplace/actions/test-publish-to-cloudflare | ||
steps: | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2.2.2 | ||
with: | ||
version: 7 | ||
|
||
- name: Setup Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
|
||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
release-type: node | ||
package-name: test-publish-to-cloudflare | ||
default-branch: main | ||
pull-request-title-pattern: "🚀 Release ${component} ${version}" | ||
changelog-types: '[{"type":"feat","section":"✨ Features","hidden":false},{"type":"fix","section":"🚨 Bug Fixes","hidden":false},{"type":"hotfix","section":"🚒 Hotfixes","hidden":false},{"type":"chore","section":"👷 Maintenance","hidden":false},{"type":"docs","section":"📚 Documentation","hidden":false}]' | ||
- uses: actions/checkout@v3 | ||
- name: tag major and minor versions | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
git config user.name carlosdevpereira | ||
git config user.email carlos@carlosdevpereira.com | ||
pnpm install && pnpm build | ||
git add dist/** -f | ||
git tag -d v${{ steps.release.outputs.major }} || true | ||
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | ||
git push origin :v${{ steps.release.outputs.major }} || true | ||
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true | ||
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" | ||
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" | ||
git push origin v${{ steps.release.outputs.major }} | ||
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} |
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,41 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2.2.2 | ||
with: | ||
version: 7 | ||
|
||
- name: Setup Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies 📦 | ||
run: pnpm install | ||
|
||
- name: Test & Publish to Cloudflare 🧪 | ||
uses: carlosdevpereira/test-publish-to-cloudflare@v1 | ||
with: | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
branchName: ${{ github.ref_name }} | ||
cloudflareProjectName: test-publish-to-cloudflare | ||
cloudflareApiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
cloudflareAccountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
baseCloudflareDeploymentUrl: test-publish-to-cloudflare.pages.dev |