Normalise incoming paths before checking them against signature (#434) #842
This file contains 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: Build and test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
# prevent from running on forks | |
if: github.repository_owner == 'restatedev' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [19.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: "https://registry.npmjs.org" | |
- run: npm run clean | |
- run: npm ci | |
- run: npm run proto | |
- run: npm run verify | |
- run: npm pack --workspaces true --include-workspace-root false | |
- run: find -type f -name "restatedev-restate-sdk-[0-9.]*\.tgz" | xargs -I {} mv {} restatedev-restate-sdk.tgz | |
- run: find -type f -name "restatedev-restate-sdk-clients-[0-9.]*\.tgz" | xargs -I {} mv {} restatedev-restate-sdk-clients.tgz | |
- run: find -type f -name "restatedev-restate-sdk-core-[0-9.]*\.tgz" | xargs -I {} mv {} restatedev-restate-sdk-core.tgz | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: restatedev-restate-sdk | |
path: restatedev-restate-sdk.tgz | |
retention-days: 1 | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: restatedev-restate-sdk-clients | |
path: restatedev-restate-sdk-clients.tgz | |
retention-days: 1 | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: restatedev-restate-sdk-core | |
path: restatedev-restate-sdk-core.tgz | |
retention-days: 1 | |
if-no-files-found: error | |
- name: Publish snapshot | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
# We're using 0.0.0 to avoid this version to be higher than released versions. | |
# To use it: | |
# "@restatedev/restate-sdk": "^0.0.0-SNAPSHOT" | |
# Hack around the fact that npm version simply doesn't update dependants -_-" | |
# see https://github.com/npm/cli/pull/4588 | |
VERSION="0.0.0-SNAPSHOT-$(date '+%Y%m%d%H%M%S')" | |
npm --workspaces version $VERSION --no-git-tag-version --no-workspaces-update | |
set() { | |
npm --workspaces pkg get "dependencies.$1" | | |
jq -r 'with_entries(select(.value != {})) | keys[]' | | |
xargs -I% npm --workspace % pkg set "dependencies.$1=$VERSION" | |
} | |
set "@restatedev/restate-sdk-core" | |
set "@restatedev/restate-sdk" | |
set "@restatedev/restate-sdk-clients" | |
npm --workspaces update | |
# We use dist-tag dev for the snapshot releases, see https://docs.npmjs.com/cli/v9/commands/npm-dist-tag for more info | |
# A snapshot MUST not be published with latest tag (omitting --tag defaults to latest) to avoid users to install snapshot releases | |
# when using npm install | |
npm publish --workspaces true --tag dev --access public --include-workspace-root false | |
e2e: | |
permissions: | |
contents: read | |
issues: read | |
checks: write | |
pull-requests: write | |
actions: read | |
secrets: inherit | |
needs: build | |
uses: restatedev/e2e/.github/workflows/e2e.yaml@main | |
with: | |
sdkTypescriptCommit: ${{ github.event.pull_request.head.sha || github.sha }} | |
e2eRef: main |