<commit_before>name: Release

on:
  push:
    tags:
      - "v*"
  workflow_dispatch:

jobs:
  release-cli-to-npm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
        with:
          node-version: 14
          registry-url: https://registry.npmjs.org/
      - run: cd cli
      - run: npm ci
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{secrets.npm_token}}

  tag-docker-images:
    runs-on: ubuntu-latest
    steps:
      - name: Login to GitHub Container Registry
        run: echo "${{ inputs.password }}" | docker login https://ghcr.io -u ${{ inputs.username }} --password-stdin

      - name: Tag latest images with release version
        run: |
          VERSION="2.1.0"
          IMAGES="alex-frontend alex-backend alex-cli alex-docs"

          for img in $IMAGES
          do
            echo "ghcr.io/learnlib/alex/$img:$VERSION"
            docker pull "ghcr.io/learnlib/alex/$img:unstable"
            docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:$VERSION"
            docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:latest"
            docker push "ghcr.io/learnlib/alex/$img:$VERSION"
            docker push "ghcr.io/learnlib/alex/$img:latest"
          done
<commit_msg>update release workflow<commit_after>name: Release

on:
  push:
    tags:
      - "v*"
  workflow_dispatch:

jobs:
  release-cli-to-npm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions/setup-node@v1
        with:
          node-version: 14
          registry-url: https://registry.npmjs.org/
      - run: cd cli
      - run: npm ci
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{secrets.npm_token}}

  tag-docker-images:
    runs-on: ubuntu-latest
    steps:
      - name: Login to GitHub Container Registry
        run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin

      - name: Tag latest images with release version
        run: |
          VERSION="2.1.0"
          IMAGES="alex-frontend alex-backend alex-cli alex-docs"

          for img in $IMAGES
          do
            echo "ghcr.io/learnlib/alex/$img:$VERSION"
            docker pull "ghcr.io/learnlib/alex/$img:unstable"
            docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:$VERSION"
            docker tag "ghcr.io/learnlib/alex/$img:unstable" "ghcr.io/learnlib/alex/$img:latest"
            docker push "ghcr.io/learnlib/alex/$img:$VERSION"
            docker push "ghcr.io/learnlib/alex/$img:latest"
          done

{'fraction_non_alphanumeric': 0.128454070201643, 'fraction_numerical': 0.005227781926811053, 'mean_word_length': 2.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2986330', 'n_tokens_mistral': 950, 'n_tokens_neox': 860, 'n_words': 182}