Repository navigation
Publish to GitHub Packages #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to GitHub Packages | |
| on: | |
| release: | |
| types: [created] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| uses: ./.github/workflows/browser-tests.yml | |
| secrets: inherit | |
| build-and-publish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure Git for private repos | |
| run: | | |
| git config --global user.name "bstruct" | |
| git config --global user.email "git@bstruct.com" | |
| git config --global url."https://${{ secrets.GIT_TOKEN }}@github.com/".insteadOf "https://github.com/" | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: Build WASM package | |
| run: wasm-pack build --target web --release | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@bstruct' | |
| - name: Configure package for GitHub Packages | |
| run: | | |
| cd pkg | |
| node -e "const pkg = require('./package.json'); pkg.name = '@bstruct/website_component_table'; pkg.publishConfig = { registry: 'https://npm.pkg.github.com' }; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));" | |
| - name: Publish to GitHub Packages | |
| run: | | |
| cd pkg | |
| npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |