twistlock 0.0.0-development

Docker <> Rust interface
Documentation
name: Test Release (do a dry run)

env:
  # Use docker.io for Docker Hub if empty
  REGISTRY: ghcr.io
  # github.repository as <account>/<repo>
  IMAGE_NAME: ${{ github.repository }}

on:
  workflow_dispatch: # releasing is manual as we don't want to release every time

permissions:
  contents: write
  issues: read
  pull-requests: read

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - name: Only on main
        if: github.ref != 'refs/heads/main'
        shell: bash
        run: |
          echo "Only to be executed on main"
          exit 1

      - name: Checkout
        uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

      - name: Setup Node.js
        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
        with:
          node-version-file: ".nvmrc"
          cache: "npm"
          cache-dependency-path: "**/package-lock.json"

      - name: Install dependencies
        shell: bash
        run: |
          npm ci --ignore-scripts

      - name: Release
        shell: bash
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          echo "::group::Release dry run output"
          npm run release -- --dry-run
          echo "::endgroup::"