Skip to content

Commit 4a73154

Browse files
committed
releases
1 parent db0c0e9 commit 4a73154

File tree

1 file changed

+24
-40
lines changed

1 file changed

+24
-40
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -42,64 +42,48 @@ jobs:
4242
run: npm install
4343

4444
- name: Build
45-
run: npm run build
45+
run: |
46+
npx parcel build --public-url /dist/
47+
cp dist/spreadsheet_component.html spreadsheet.dist.handlebars
48+
npx parcel build --public-url https://lovasoa.github.io/sqlpage-spreadsheet/dist/
49+
cp dist/spreadsheet_component.html spreadsheet.handlebars
4650
4751
- name: Create Release ZIP
4852
run: |
4953
mkdir -p release/dist
5054
cp -r dist/* release/dist/
5155
mkdir -p release/sqlpage/templates
52-
cp dist/spreadsheet_component.html release/sqlpage/templates/spreadsheet.handlebars
56+
cp spreadsheet.dist.handlebars release/sqlpage/templates/spreadsheet.handlebars
5357
cd release
5458
zip -r ../release.zip .
5559
5660
- name: Create Release
57-
id: create_release
58-
uses: actions/create-release@v1
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
uses: softprops/action-gh-release@v2
6162
with:
62-
tag_name: ${{ github.ref }}
63-
release_name: Release ${{ github.ref }}
64-
draft: false
65-
prerelease: false
66-
67-
- name: Upload Release Asset
68-
uses: actions/upload-release-asset@v1
63+
files: |
64+
release.zip
65+
spreadsheet.handlebars
66+
README.md
67+
body: |
68+
To install the Spreadsheet component:
69+
70+
Copy the spreadsheet.handlebars file to your project's 'sqlpage/templates' directory.
71+
You can then use the component in your SQLPage project with `select 'spreadsheet' as component`.
72+
73+
The default distribution downloads the spreadsheet assets at runtime from the internet.
74+
If you want to install the component entirely offline, you can use the `release.zip` distribution:
75+
1. Unzip the release.zip file
76+
2. Copy the contents of the 'dist' folder to a 'dist' directory at the root of your project
77+
3. Copy 'sqlpage/templates/spreadsheet.handlebars' to your project's 'sqlpage/templates' directory
6978
env:
7079
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
with:
72-
upload_url: ${{ steps.create_release.outputs.upload_url }}
73-
asset_path: ./release.zip
74-
asset_name: release.zip
75-
asset_content_type: application/zip
76-
77-
- name: Create README.md
78-
run: |
79-
echo "# Spreadsheet Component Installation" > README.md
80-
echo "" >> README.md
81-
echo "To install the Spreadsheet component:" >> README.md
82-
echo "1. Unzip the release.zip file" >> README.md
83-
echo "2. Copy the contents of the 'dist' folder to your project's 'dist' directory" >> README.md
84-
echo "3. Copy 'sqlpage/templates/spreadsheet.handlebars' to your project's 'sqlpage/templates' directory" >> README.md
85-
86-
- name: Upload README.md
87-
uses: actions/upload-release-asset@v1
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90-
with:
91-
upload_url: ${{ steps.create_release.outputs.upload_url }}
92-
asset_path: ./README.md
93-
asset_name: README.md
94-
asset_content_type: text/markdown
9580

9681
- name: Deploy to GitHub Pages
9782
run: |
9883
git config --global user.name 'GitHub Actions'
9984
git config --global user.email '[email protected]'
10085
git checkout --orphan gh-pages
10186
git rm -rf .
102-
cp -r dist/* .
103-
git add .
87+
git add dist
10488
git commit -m "Deploy to GitHub Pages"
105-
git push -f origin gh-pages
89+
git push -f origin gh-pages:gh-pages

0 commit comments

Comments
 (0)