diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a7ea461 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish + +permissions: + id-token: write + +on: + release: + types: [published] + +jobs: + publish: + name: Typir Publish + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - name: Build + shell: bash + run: | + npm ci + npm run clean + npm run build + - name: Test + if: success() || failure() + shell: bash + run: | + npm run test + - name: Publish NPM Packages + shell: bash + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # Update the following list when a new npm package is added + run: | + npm run publish:latest --provenance --workspace=typir + npm run publish:latest --provenance --workspace=typir-langium diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..7314eaa --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,12 @@ +# Release Process + +The release process is mostly automated and requires running only a few commands. After commiting, pushing, tagging and releasing the changes, a GitHub Action will publish all npm packages. + +1. Pull the latest changes +2. Uplift the package versions + Run `npm version major|minor|patch --no-git-tag-version --workspaces` +3. Update the dependency versions + Run `npm run version:dependencies` +4. Create a PR with your updated changes, get a review and merge it +5. Create a version tag on the latest commit on main and push it +6. Create a GitHub release from the new tag (this will automatically publish all artifacts)