Skip to content

Commit

Permalink
chore: release
Browse files Browse the repository at this point in the history
  • Loading branch information
kettei-sproutty committed Jan 16, 2024
1 parent 9c4dfeb commit 47a28b1
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- run: wasm-pack pack
if: ${{ steps.release.outputs.release_created }}
- name: Update Package Name
run: |
# Set the new name for the "name" field
new_name="@scuderia-fe/docx-to-html"
if [ -d "pkg" ]; then
cd pkg || exit
if [ -f "package.json" ]; then
# Update the "name" field in package.json
sed -i "s/\"name\": \".*\",/\"name\": \"$new_name\",/" package.json
echo "Package name updated to $new_name"
else
echo "Error: package.json not found in the pkg folder."
fi
cd ..
else
echo "Error: pkg folder not found."
fi
- run: wasm-pack publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@
target

# WASM
pkg
pkg

# NPMJS
.npmrc

# Env
.env
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "docx-to-html"
version = "0.1.0"
repository = "https://github.com/scuderia-fe/docx-to-html"
authors = ["Alessio Marchi <65831826+kettei-sproutty@users.noreply.github.com>"]
description = "Converts a docx file to html"
license = "MIT"
Expand Down
Binary file modified example/bun.lockb
Binary file not shown.
5 changes: 2 additions & 3 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@
</form>

<p class="mt-10 text-center text-sm text-gray-500">
Repository
<a
href="#"
href="https://github.com/scuderia-fe/docx-to-html"
class="font-semibold leading-6 text-indigo-600 hover:text-indigo-500"
>Look at the code</a
>Repository</a
>
</p>
<p class="mt-10 text-center print:hidden dark:text-white text-black">
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dev": "concurrently \"bun dev:wasm\" \"bun dev:vite\""
},
"dependencies": {
"docx-to-html": "file:../pkg"
"@scuderia-fe/docx-to-html": "file:../pkg"
},
"devDependencies": {
"autoprefixer": "^10.4.16",
Expand Down
2 changes: 1 addition & 1 deletion example/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './main.css';
import * as wasm from 'docx-to-html';
import * as wasm from '@scuderia-fe/docx-to-html';

const form = document.querySelector('form') as HTMLFormElement | null;
const fileInput = document.querySelector('input') as HTMLInputElement | null;
Expand Down

0 comments on commit 47a28b1

Please sign in to comment.