-
Notifications
You must be signed in to change notification settings - Fork 57
Internal: Update build and create NPM package [ED-7724] #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 7 commits
afff3bb
2431b42
a8fb5bc
9c22c3c
95ec7b2
e06acef
ecc1989
6d52fa6
851d95b
c761ec2
9215bb2
d51d277
cd7b4f8
0db1e5c
9809181
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| name: Node CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [16.x] | ||
matipojo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - name: Install Dependencies | ||
| run: npm ci | ||
| - name: Build | ||
| run: npm run build | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: pre-release | ||
|
||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| pre-release: | ||
| if: contains(github.event.comment.body, 'prerelease') | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [16.x] | ||
|
|
||
| steps: | ||
| - uses: actions/github-script@v1 | ||
|
||
| id: pr | ||
| with: | ||
| result-encoding: string | ||
| script: | | ||
| return github.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.payload.issue.number | ||
| }).then( (pr) => { return pr.data.head.ref }) | ||
| - name: React to comment | ||
| uses: actions/github-script@v4 | ||
yotamselementor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| with: | ||
| script: | | ||
| const {owner, repo} = context.issue | ||
| github.reactions.createForIssueComment({ | ||
| owner, | ||
| repo, | ||
| comment_id: context.payload.comment.id, | ||
| content: "eyes", | ||
| }); | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ steps.pr.outputs.result }} | ||
| - name: Get Latest Tag | ||
| run: echo "LATEST_TAG=$(git tag '--sort=version:refname'| tail -1 | awk '{ print } END { if (!NR) print "0.0.0" }')" >> $GITHUB_ENV | ||
| - name: Calculate version | ||
| run: | | ||
| export BRANCH=$(echo ${{steps.pr.outputs.result}} | sed 's/_/-/g' | cut -d- -f2) | ||
| export COMMIT=$(git rev-parse --short HEAD) | ||
| echo "VERSION=${BRANCH}-${COMMIT}" >> $GITHUB_ENV | ||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| registry-url: https://npm.pkg.github.com/ | ||
| scope: ${{ github.repository_owner }} | ||
| - run: npm install | ||
| - run: npm ci | ||
| - run: npm version ${{ env.LATEST_TAG }}-${{ env.VERSION }} --no-git-tag-version | ||
| - run: npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: 'Comment PR' | ||
| uses: actions/github-script@0.3.0 | ||
yotamselementor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const { issue: { number: issue_number }, repo: { owner, repo } } = context; | ||
| github.issues.createComment({ issue_number, owner, repo, body: 'done, package version: ${{ env.LATEST_TAG }}-${{ env.VERSION }}' }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: publish | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [16.x] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| registry-url: https://npm.pkg.github.com/ | ||
| scope: ${{ github.repository_owner }} | ||
| - run: npm install | ||
| - run: npm ci | ||
| - run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version | ||
| - run: npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [ closed ] | ||
|
|
||
| jobs: | ||
| release: | ||
| if: github.event.pull_request.merged == true && github.base_ref == 'master' && !contains(github.event.pull_request.labels.*.name, 'skip release') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Get Latest Tag | ||
| run: echo "LATEST_TAG=$(git tag '--sort=version:refname'| tail -1 | awk '{ print } END { if (!NR) print "0.0.0" }')" >> $GITHUB_ENV | ||
| - name: Increment Tag | ||
| uses: actions-ecosystem/action-bump-semver@v1 | ||
| id: bump-semver | ||
| with: | ||
| current_version: ${{ env.LATEST_TAG }} | ||
| level: patch | ||
| - name: Create Release | ||
| id: create_release | ||
| uses: actions/create-release@latest | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.CLOUD_DEVOPS_TOKEN }} | ||
| with: | ||
| tag_name: ${{ steps.bump-semver.outputs.new_version }} | ||
| release_name: "${{ steps.bump-semver.outputs.new_version }}: ${{ github.event.pull_request.title }}" | ||
| draft: false | ||
| prerelease: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,5 +10,9 @@ composer.lock | |
| Thumbs.db | ||
| yarn.lock | ||
|
|
||
| # Generated code | ||
| css | ||
| eicons.json | ||
|
|
||
| *.log | ||
| *.map | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.