Skip to content

Commit

Permalink
CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
risen228 committed Jul 19, 2024
1 parent d8d9dc7 commit b181566
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 68 deletions.
File renamed without changes.
33 changes: 0 additions & 33 deletions .github/workflows/cache-build.yml

This file was deleted.

33 changes: 11 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ jobs:
git config --global user.email "<>"
- name: Checkout to tag
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
fetch-depth: 0

- name: Extract version
id: tag
uses: olegtarasov/get-tag@v2.1.1
with:
tagRegex: 'v(?<full>(?<version>[0-9.]*)(?:-(?<rc>.*))?)'
- name: Parse version from tag
id: version
uses: release-kit/semver@v2

- name: Get release branch name
id: release-branch
run: echo "::set-output name=name::${{ steps.tag.outputs.rc != null && 'release/${{ steps.tag.outputs.rc }}' || 'release/latest' }}"
run: echo "::set-output name=name::${{ steps.version.outputs.prerelease != null && 'release/${{ steps.version.outputs.prerelease }}' || 'release/latest' }}"

- name: Checkout/create release branch
run: git checkout ${{ steps.release-branch.outputs.name }} || git checkout -b ${{ steps.release-branch.outputs.name }}
Expand All @@ -52,20 +50,11 @@ jobs:
force: true
unprotect_reviews: true

- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: Check build cache
id: cache
uses: actions/cache@v3
- uses: actions/setup-node@v4
with:
path: dist
key: ${{ hashFiles('./yarn.lock', './src/**', './rollup.config.js', './jest.config.js') }}
node-version: 20

- name: Create a new build
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install --frozen-lockfile
yarn test
Expand All @@ -74,17 +63,17 @@ jobs:
- name: Set version from release
uses: reedyuk/npm-version@1.0.1
with:
version: ${{ steps.tag.outputs.full }}
version: ${{ steps.version.outputs.full }}

- name: Create NPM config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish latest
if: ${{ steps.tag.outputs.rc == null }}
if: ${{ steps.version.outputs.prerelease == '' }}
run: npm publish

- name: Publish RC
if: ${{ steps.tag.outputs.rc != null }}
run: npm publish --tag ${{ steps.tag.outputs.rc }}
if: ${{ steps.version.outputs.prerelease != '' }}
run: npm publish --tag ${{ steps.version.outputs.prerelease }}
15 changes: 3 additions & 12 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,13 @@ jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: Use build cache
id: cache
uses: actions/cache@v3
with:
path: dist
key: ${{ hashFiles('./yarn.lock', './src/**', './rollup.config.js', './jest.config.js') }}
node-version: 20

- name: Create a new build
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install --frozen-lockfile
yarn test
Expand Down
2 changes: 2 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node = "~20"
yarn = "4.2.2"
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"@app": ["./src"],
"@app/*": ["./src/*"]
}
}
},
"include": ["src", ".eslintrc.cjs"]
}

0 comments on commit b181566

Please sign in to comment.