Skip to content

Commit 3fbe9ba

Browse files
authored
Merge pull request #5 from libxmlwasm/develop
1.0.0 release
2 parents 6e7d224 + 7c47c80 commit 3fbe9ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5160
-7878
lines changed

.dockerignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
.github
2-
.git
3-
.dockerignore
4-
scripts
5-
Dockerfile
1+
node_modules
2+
.pnpm-store

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ updates:
1010
directory: "/"
1111
schedule:
1212
interval: weekly
13+
target-branch: "develop"
14+
- package-ecosystem: "npm"
15+
directory: "/"
16+
schedule:
17+
interval: weekly
18+
target-branch: "develop"

.github/workflows/build.yml

Lines changed: 85 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
1-
name: Build and Test
1+
name: Build and Test and Publish
22

33
on:
44
push:
55
paths-ignore:
6-
- 'README.md'
6+
- README.md
7+
- LICENSE
8+
9+
710
workflow_dispatch:
811
inputs:
912
skip-build-image:
1013
description: Skip building the builder image
1114
type: boolean
1215
default: false
1316

17+
release:
18+
types: [published]
19+
20+
pull_request:
21+
types: [opened, synchronize, reopened]
22+
1423
concurrency:
1524
group: ${{ github.workflow }}-${{ github.ref }}
1625
cancel-in-progress: true
1726

27+
env:
28+
GITHUB_TOKEN: "_DUMMY_"
29+
NODE_AUTH_TOKEN: "_DUMMY_"
30+
1831
jobs:
1932
build-image:
2033
name: Preapre builder image
@@ -30,7 +43,7 @@ jobs:
3043
- uses: docker/login-action@v3
3144
with:
3245
registry: ghcr.io
33-
username: ${{ github.actor }}
46+
username: ${{ github.repository_owner }}
3447
password: ${{ secrets.GITHUB_TOKEN }}
3548
- uses: docker/metadata-action@v5
3649
id: meta
@@ -40,9 +53,15 @@ jobs:
4053
type=raw,value=latest
4154
type=ref,event=branch
4255
type=ref,event=pr
56+
type=ref,event=tag
4357
type=semver,pattern={{version}}
4458
type=semver,pattern={{major}}.{{minor}}
59+
type=semver,pattern={{major}}
4560
type=sha
61+
labels: |
62+
org.opencontainers.image.title=Builder
63+
org.opencontainers.image.description=Builder image for libxmlwasm
64+
org.opencontainers.image.source=${{ github.repository }}
4665
- name: Prepare container
4766
uses: docker/build-push-action@v5
4867
with:
@@ -58,24 +77,79 @@ jobs:
5877
needs: build-image
5978
steps:
6079
- uses: actions/checkout@v4
80+
- name: Cache Primes
81+
uses: actions/cache@v4
82+
with:
83+
path: |
84+
cache
85+
key: buildcache
6186
- uses: actions/setup-node@v4
6287
with:
6388
node-version-file: ".nvmrc"
89+
- uses: docker/login-action@v3
90+
with:
91+
registry: ghcr.io
92+
username: ${{ github.repository_owner }}
93+
password: ${{ secrets.GITHUB_TOKEN }}
6494
- name: Build
6595
run: |
6696
mkdir -p prefix dist wasm-build cache
6797
chmod o+w prefix dist wasm-build cache
68-
docker compose up ci
69-
- name: Check files
70-
run: ls . */
98+
docker compose up ci --no-build
7199
- name: Install dependencies
72-
run: corepack yarn install --immutable
100+
run: corepack pnpm install --frozen-lockfile
73101
- name: Run tests
74-
run: corepack yarn test
102+
run: corepack pnpm test
75103
- name: Create package tarball
76-
run: corepack yarn pack -o libxmlwasm.tgz
104+
run: corepack pnpm pack
77105
- name: Upload package tarball
78106
uses: actions/upload-artifact@v4
79107
with:
80-
name: libxmlwasm.tgz
81-
path: libxmlwasm.tgz
108+
name: libxml.wasm.tgz
109+
path: libxml.wasm-*.tgz
110+
publish:
111+
name: Publish packages
112+
runs-on: ubuntu-latest
113+
needs: build
114+
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref_name, 'dependabot/') }}
115+
permissions:
116+
contents: read
117+
packages: write
118+
steps:
119+
- uses: actions/checkout@v4
120+
- uses: actions/setup-node@v4
121+
with:
122+
node-version-file: ".nvmrc"
123+
- name: Download package tarball
124+
uses: actions/download-artifact@v4
125+
with:
126+
name: libxml.wasm.tgz
127+
- name: Unpack package tarball
128+
run: |
129+
tar axf libxml.wasm-*.tgz
130+
mv package/* .
131+
rm -fr package
132+
- name: Prepare package
133+
id: package
134+
run: |
135+
if [ ${{ github.ref_name }} = 'master' || ${{ github.ref_name }} = 'main' ]; then
136+
echo "This is the main branch"
137+
echo "tag=latest" >> $GITHUB_OUTPUT
138+
else
139+
echo "This is the develop branch"
140+
./scripts/jqout.sh '.version+="-${{ github.ref_name }}-${{ github.sha }}"' package.json
141+
echo "tag=experimental" >> $GITHUB_OUTPUT
142+
fi
143+
echo "name=$(jq .name package.json)" >> $GITHUB_OUTPUT
144+
echo "version=$(jq .version package.json)" >> $GITHUB_OUTPUT
145+
- name: Publish package to NPM
146+
env:
147+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
148+
run: |
149+
corepack pnpm publish --access public --tag ${{ steps.package.outputs.tag }} --no-git-checks
150+
- name: Publish package to GitHub Package Registry
151+
env:
152+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
run: |
154+
./scripts/jqout.sh '.name="@${{ github.repository_owner }}/wasm"' package.json
155+
corepack pnpm publish --access public --tag ${{ steps.package.outputs.tag }} --no-git-checks

.github/workflows/publish.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,5 @@ dist
136136
.yarn/build-state.yml
137137
.yarn/install-state.gz
138138
.pnp.*
139+
140+
.pnpm-store/

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@libxmlwasm:registry=https://npm.pkg.github.com
2+
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
3+
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}

.vscode/c_cpp_properties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"includePath": [
66
"${workspaceFolder}/prefix/**",
77
"${workspaceFolder}/cache/build/**",
8-
"D:/emsdk/upstream/emscripten/system/include/**"
8+
"D:/emsdk/upstream/emscripten/system/include/**",
9+
"${workspaceFolder}/wasm-build/_deps/**"
910
],
1011
"defines": [
1112
"_DEBUG",

.vscode/extensions.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
{
2-
"recommendations": [
3-
"arcanis.vscode-zipfs",
4-
"dbaeumer.vscode-eslint",
5-
"esbenp.prettier-vscode"
6-
]
7-
}
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"esbenp.prettier-vscode"
5+
]
6+
}

.vscode/settings.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@
5555
"__tuple": "cpp",
5656
"string_view": "cpp"
5757
},
58-
"search.exclude": {
59-
"**/.yarn": true,
60-
"**/.pnp.*": true
61-
},
62-
"eslint.nodePath": ".yarn/sdks",
63-
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
64-
"typescript.tsdk": ".yarn/sdks/typescript/lib",
65-
"typescript.enablePromptUseWorkspaceTsdk": true,
66-
"cmake.sourceDirectory": "C:/Users/cabbage/code/wasm/libxml_wasm/wasm",
67-
"jest.jestCommandLine": "corepack yarn run jest"
58+
"jest.jestCommandLine": "corepack pnpm run test",
59+
"jest.runMode": "on-demand",
6860
}

0 commit comments

Comments
 (0)