-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from JsDaddy/develop
release
- Loading branch information
Showing
45 changed files
with
14,261 additions
and
23,755 deletions.
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,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
commit_msg=$(cat .git/COMMIT_EDITMSG) | ||
echo "$commit_msg" | npx commitlint |
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,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
npm run lint | ||
|
||
output=$(npm run type-coverage) | ||
if echo "$output" | grep -q "lower than "; then | ||
echo "$output" | ||
exit 1 # Terminate the hook script with a non-zero exit code | ||
else | ||
echo "Type coverage is good! 🎉" | ||
fi | ||
|
||
npm run test | ||
|
||
npm run cypress:bash | ||
|
||
npm run build | ||
|
||
npm run build:lib |
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,39 @@ | ||
#!/bin/bash | ||
|
||
# Define the directory containing sample hooks | ||
SAMPLE_HOOKS_DIR=".github/hooks" | ||
|
||
# Define the target directory for Git hooks | ||
GIT_HOOKS_DIR=".git/hooks" | ||
|
||
# Function to copy or replace hooks | ||
copy_or_replace_hooks() { | ||
for hook in "$SAMPLE_HOOKS_DIR"/*; do | ||
hook_name=$(basename "$hook") | ||
target_hook="$GIT_HOOKS_DIR/$hook_name" | ||
if [ -f "$target_hook" ]; then | ||
echo "Replacing existing hook: $hook_name" | ||
else | ||
echo "Copying new hook: $hook_name" | ||
fi | ||
cp "$hook" "$target_hook" | ||
chmod ug+x "$target_hook" # Ensure executable permission is set | ||
done | ||
} | ||
|
||
# Main function | ||
main() { | ||
# Check if .git/hooks directory exists | ||
if [ ! -d "$GIT_HOOKS_DIR" ]; then | ||
echo "Error: .git/hooks directory not found. Are you in a Git repository?" | ||
exit 1 | ||
fi | ||
|
||
# Copy or replace hooks | ||
copy_or_replace_hooks | ||
|
||
echo "Git hooks setup complete." | ||
} | ||
|
||
# Run the main function | ||
main |
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 |
---|---|---|
|
@@ -11,17 +11,90 @@ jobs: | |
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Build demo | ||
node-version: 20 | ||
|
||
- name: Install deps | ||
run: | | ||
npm ci --force | ||
git submodule update --init --recursive --remote | ||
git submodule update --init --recursive --remote | ||
- name: Semantic Release | ||
id: semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npx semantic-release | ||
- name: Build demo app | ||
env: | ||
RELEASE_VERSION: ${{ steps.semantic-release.outputs.new-release-version }} | ||
run: | | ||
echo '********' | ||
echo "RELEASE_VERSION: $RELEASE_VERSION" | ||
echo '********' | ||
bash .github/workflows/scripts/replace_template.sh $RELEASE_VERSION | ||
npm run build | ||
- name: Deploy demo | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist/ngx-copypaste/browser | ||
outputs: | ||
version: ${{ steps.semantic-release.outputs.new-release-version }} | ||
|
||
slack_notification: | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Post to a Slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: 'deployments' | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Project: `${{ github.event.repository.name }}`" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Version: `${{ needs.build.outputs.version || 'TBA' }}`" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Commit/PR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Website URL: ${{ secrets.WEBSITE_URL || 'TBA' }}" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_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
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,21 @@ | ||
#!/usr/bin | ||
|
||
set -e | ||
|
||
npm run lint | ||
|
||
output=$(npm run type-coverage) | ||
if echo "$output" | grep -q "lower than "; then | ||
echo "$output" | ||
exit 1 # Terminate the hook script with a non-zero exit code | ||
else | ||
echo "Type coverage is good! 🎉" | ||
fi | ||
|
||
npm run test | ||
|
||
npm run cypress:bash | ||
|
||
npm run build | ||
|
||
npm run build:lib |
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,15 @@ | ||
#!/bin/bash | ||
|
||
# Check if the correct number of arguments are provided | ||
if [ $# -ne 1 ]; then | ||
echo "Usage: $0 <version>" | ||
exit 1 | ||
fi | ||
|
||
# Assign arguments to variables | ||
custom_string="$1" | ||
|
||
# Perform the replacement and save to output file | ||
sed "s/<%version%>/$custom_string/g" "angular.json" > "angular.json.tmp" && mv "angular.json.tmp" "angular.json" | ||
|
||
echo "Template string replaced successfully. 🎉" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
branches: | ||
- develop | ||
|
||
plugins: | ||
- '@semantic-release/commit-analyzer' | ||
- '@semantic-release/github' | ||
- 'semantic-release-export-data' |
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
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.