Skip to content

Commit

Permalink
Merge pull request #5 from libxmlwasm/develop
Browse files Browse the repository at this point in the history
1.0.0 release
  • Loading branch information
pycabbage authored May 13, 2024
2 parents 6e7d224 + 7c47c80 commit 3fbe9ba
Show file tree
Hide file tree
Showing 43 changed files with 5,160 additions and 7,878 deletions.
7 changes: 2 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
.github
.git
.dockerignore
scripts
Dockerfile
node_modules
.pnpm-store
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ updates:
directory: "/"
schedule:
interval: weekly
target-branch: "develop"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: weekly
target-branch: "develop"
96 changes: 85 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
name: Build and Test
name: Build and Test and Publish

on:
push:
paths-ignore:
- 'README.md'
- README.md
- LICENSE


workflow_dispatch:
inputs:
skip-build-image:
description: Skip building the builder image
type: boolean
default: false

release:
types: [published]

pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
GITHUB_TOKEN: "_DUMMY_"
NODE_AUTH_TOKEN: "_DUMMY_"

jobs:
build-image:
name: Preapre builder image
Expand All @@ -30,7 +43,7 @@ jobs:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
Expand All @@ -40,9 +53,15 @@ jobs:
type=raw,value=latest
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
labels: |
org.opencontainers.image.title=Builder
org.opencontainers.image.description=Builder image for libxmlwasm
org.opencontainers.image.source=${{ github.repository }}
- name: Prepare container
uses: docker/build-push-action@v5
with:
Expand All @@ -58,24 +77,79 @@ jobs:
needs: build-image
steps:
- uses: actions/checkout@v4
- name: Cache Primes
uses: actions/cache@v4
with:
path: |
cache
key: buildcache
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
mkdir -p prefix dist wasm-build cache
chmod o+w prefix dist wasm-build cache
docker compose up ci
- name: Check files
run: ls . */
docker compose up ci --no-build
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack pnpm install --frozen-lockfile
- name: Run tests
run: corepack yarn test
run: corepack pnpm test
- name: Create package tarball
run: corepack yarn pack -o libxmlwasm.tgz
run: corepack pnpm pack
- name: Upload package tarball
uses: actions/upload-artifact@v4
with:
name: libxmlwasm.tgz
path: libxmlwasm.tgz
name: libxml.wasm.tgz
path: libxml.wasm-*.tgz
publish:
name: Publish packages
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref_name, 'dependabot/') }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Download package tarball
uses: actions/download-artifact@v4
with:
name: libxml.wasm.tgz
- name: Unpack package tarball
run: |
tar axf libxml.wasm-*.tgz
mv package/* .
rm -fr package
- name: Prepare package
id: package
run: |
if [ ${{ github.ref_name }} = 'master' || ${{ github.ref_name }} = 'main' ]; then
echo "This is the main branch"
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "This is the develop branch"
./scripts/jqout.sh '.version+="-${{ github.ref_name }}-${{ github.sha }}"' package.json
echo "tag=experimental" >> $GITHUB_OUTPUT
fi
echo "name=$(jq .name package.json)" >> $GITHUB_OUTPUT
echo "version=$(jq .version package.json)" >> $GITHUB_OUTPUT
- name: Publish package to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
corepack pnpm publish --access public --tag ${{ steps.package.outputs.tag }} --no-git-checks
- name: Publish package to GitHub Package Registry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/jqout.sh '.name="@${{ github.repository_owner }}/wasm"' package.json
corepack pnpm publish --access public --tag ${{ steps.package.outputs.tag }} --no-git-checks
44 changes: 0 additions & 44 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,5 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

.pnpm-store/
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@libxmlwasm:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
3 changes: 2 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"includePath": [
"${workspaceFolder}/prefix/**",
"${workspaceFolder}/cache/build/**",
"D:/emsdk/upstream/emscripten/system/include/**"
"D:/emsdk/upstream/emscripten/system/include/**",
"${workspaceFolder}/wasm-build/_deps/**"
],
"defines": [
"_DEBUG",
Expand Down
13 changes: 6 additions & 7 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
12 changes: 2 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@
"__tuple": "cpp",
"string_view": "cpp"
},
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"cmake.sourceDirectory": "C:/Users/cabbage/code/wasm/libxml_wasm/wasm",
"jest.jestCommandLine": "corepack yarn run jest"
"jest.jestCommandLine": "corepack pnpm run test",
"jest.runMode": "on-demand",
}
Loading

0 comments on commit 3fbe9ba

Please sign in to comment.