Skip to content

Commit

Permalink
ci: fix publish
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoninoBonanno committed Mar 10, 2024
1 parent 7649073 commit d4fe796
Show file tree
Hide file tree
Showing 9 changed files with 406 additions and 22 deletions.
1 change: 1 addition & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install zip
run: apt-get install zip

- name: Install dependencies
run: npm ci

# - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
# run: npm audit signatures

- name: Build
run: npm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/sonarlint
node_modules
/build/build.zip
44 changes: 23 additions & 21 deletions .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,6 @@ module.exports = {
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
// Creating the release and tag on GitHub
"@semantic-release/github",
{
"assets": [
{
"path": [
"example/**",
"src/dragDropAnnotate.min.js",
"src/dragDropAnnotate.min.css",
"LICENSE",
"README.md"
],
"name": "DragDropAnnotate-v${nextRelease.version}",
"label": "DragDropAnnotate - v${nextRelease.version}"
},
]
}
],
[
// This will increase the version in the project without publishing it
"@semantic-release/npm",
Expand All @@ -35,6 +16,7 @@ module.exports = {
}
],
[
// Replace __VERSION__ from "src/dragDropAnnotate.min.js" file with correct version
"semantic-release-replace-plugin",
{
"replacements": [
Expand All @@ -55,6 +37,26 @@ module.exports = {
]
}
],
[
// Creating the zip file
"@semantic-release/exec",
{
"prepareCmd": "./build/create-zip.sh"
}
],
[
// Creating the release and tag on GitHub
"@semantic-release/github",
{
"assets": [
{
"path": "build/build.zip",
"name": "DragDropAnnotate-v${nextRelease.version}.zip",
"label": "DragDropAnnotate - v${nextRelease.version}"
},
]
}
],
[
// Commit with the new updated files
"@semantic-release/git",
Expand All @@ -63,8 +65,8 @@ module.exports = {
"CHANGELOG.md",
"package.json",
"package-lock.json",
"dragDropAnnotate.min.js",
"dragDropAnnotate.min.css"
"src/dragDropAnnotate.min.js",
"src/dragDropAnnotate.min.css"
],
"message": "chore(release): ${nextRelease.version} :tada: [skip ci]\n\n${nextRelease.notes}"
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<p align="center">
<a href="https://github.com/AntoninoBonanno/DragDropAnnotate/releases"><img src="https://img.shields.io/github/v/release/AntoninoBonanno/DragDropAnnotate?label=Latest%20release" alt="Latest release"></a>
<a href="https://github.com/semantic-release/semantic-release"><img src="https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release" alt="semantic-release: conventional" /></a>
</p>

jQuery plugin to annotate images easily with drag and drop.
Expand Down
2 changes: 2 additions & 0 deletions build/create-zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
zip -r ./build/build.zip example src/dragDropAnnotate.min.js src/dragDropAnnotate.min.css LICENSE README.md
Loading

0 comments on commit d4fe796

Please sign in to comment.