-
Notifications
You must be signed in to change notification settings - Fork 50
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
Internal: Update build and create NPM package [ED-7724] #70
Open
yotamselementor
wants to merge
15
commits into
master
Choose a base branch
from
build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
afff3bb
Remove generated code from Git
yotamselementor 2431b42
Migrate Sass from Grunt
yotamselementor a8fb5bc
Migrate Post CSS from Grunt
yotamselementor 9c22c3c
Migrate SVG Icons JSON generation from Grunt
yotamselementor 95ec7b2
Upgrade node modules
yotamselementor e06acef
Migrate scripts to MJS
yotamselementor ecc1989
Add GitHub Actions
yotamselementor 6d52fa6
Add ESLint Support
yotamselementor 851d95b
Add ESLint Support to CI
yotamselementor c761ec2
Rename ci.yml to build.yml
yotamselementor 9215bb2
Update .github/workflows/prerelease.yml
yotamselementor d51d277
Update .github/workflows/prerelease.yml
yotamselementor cd7b4f8
Update .github/workflows/prerelease.yml
yotamselementor 0db1e5c
Remove prerelease action
yotamselementor 9809181
Merge branch 'build' of github.com:elementor/elementor-icons into build
yotamselementor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 @@ | ||
css |
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,20 @@ | ||
module.exports = { | ||
extends: [ | ||
'plugin:@wordpress/eslint-plugin/recommended-with-formatting', | ||
], | ||
plugins: [], | ||
globals: { | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2017, | ||
requireConfigFile: false, | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
}, | ||
settings: { | ||
jsdoc: { | ||
mode: 'typescript', | ||
}, | ||
}, | ||
}; |
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,27 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
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: Lint | ||
run: npm run lint | ||
- name: Build | ||
run: npm run build |
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,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@v6 | ||
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@v6 | ||
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@v6 | ||
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 }}' }); |
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,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 }} |
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,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 |
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 |
---|---|---|
|
@@ -10,5 +10,9 @@ composer.lock | |
Thumbs.db | ||
yarn.lock | ||
|
||
# Generated code | ||
css | ||
eicons.json | ||
|
||
*.log | ||
*.map |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure we want this pre-release action on a public repository. everyone will be able to publish new packages, doesnt make much sense.
we need the pre-release appraoch as Manual action that will be executed on demand by developers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 0db1e5c