# release workflow (remix-run/history)

> The release workflow from remix-run/history, explained and optimized by Latchkey.

Source: https://latchkey.dev/workflows/remix-run-history-release  
Upstream: [remix-run/history](https://github.com/remix-run/history/blob/dev/.github/workflows/release.yml) (.github/workflows/release.yml), licence MIT

## What it does

This is the release workflow from the remix-run/history repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

## The workflow

```yaml
name: release
on:
  release:
    types: [published]

jobs:
  release:
    if: github.repository == 'remix-run/history'
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x]

    steps:
      - uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

        # https://github.com/actions/setup-node/issues/213#issuecomment-833724757
      - name: Install npm v7
        run: npm i -g npm@7 --registry=https://registry.npmjs.org

      - name: Install dependencies
        run: npm ci

      - name: Build
        run: npm run build

      - name: Test
        run: npm run test & npm run size

      - name: Publish
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: |
          echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
          node scripts/publish.js
```

## FAQ

### What does the release workflow (remix-run/history) workflow do?

This is the release workflow from the remix-run/history repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

### What CI health grade does this workflow get?

This Node.js workflow grades C. Paste your own workflow into the Latchkey grader to see its grade and the exact fixes.

### How can I improve this Node.js workflow?

Add caching and job timeouts. Latchkey applies these automatically on managed runners when you point runs-on at Latchkey.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
