name: Release

on:
  # New release tagged.
  push:
    tags:
      - 'v[0-9]+.[0-9]+.*'
  # Manual trigger.
  workflow_dispatch:

jobs:
  release:
    if: startsWith(github.ref, 'refs/tags/v')
    runs-on: ubuntu-latest
    permissions:
      # This is broad, but unfortunately it is required for creating
      # releases.
      contents: write
    steps:
      - uses: actions/checkout@v3
      - uses: bazelbuild/setup-bazelisk@v2
      - run: bazel build ...
      - run: bazel test --test_output=errors ...
      - name: Create Release
        uses: softprops/action-gh-release@v1
        with:
          generate_release_notes: true
          files: |
            chrome-ssh-agent.zip
      - name: Publish to Webstore
        run: bazel run release:publish
        env:
          EXTENSION_ID: eechpbnaifiimgajnomdipfaamobdfha
          WEBSTORE_CLIENT_ID: ${{ secrets.WEBSTORE_CLIENT_ID }}
          WEBSTORE_CLIENT_SECRET: ${{ secrets.WEBSTORE_CLIENT_SECRET }}
          WEBSTORE_REFRESH_TOKEN: ${{ secrets.WEBSTORE_REFRESH_TOKEN }}

name: Release

on:
  # New release tagged.
  push:
    tags:
      - 'v[0-9]+.[0-9]+.*'
  # Manual trigger.
  workflow_dispatch:

jobs:
  release:
    if: startsWith(github.ref, 'refs/tags/v')
    runs-on: ubuntu-latest
    permissions:
      # This is broad, but unfortunately it is required for creating
      # releases.
      contents: write
    steps:
      - uses: actions/checkout@v3
      - uses: bazelbuild/setup-bazelisk@v2
      - run: bazel build ...
      - run: bazel test --test_output=errors ...
      - name: Create Release
        uses: softprops/action-gh-release@v1
        with:
          generate_release_notes: true
          fail_on_unmatched_files: true
          files: |
            bazel-bin/chrome-ssh-agent.zip
      - name: Publish to Webstore
        run: bazel run release:publish
        env:
          EXTENSION_ID: eechpbnaifiimgajnomdipfaamobdfha
          WEBSTORE_CLIENT_ID: ${{ secrets.WEBSTORE_CLIENT_ID }}
          WEBSTORE_CLIENT_SECRET: ${{ secrets.WEBSTORE_CLIENT_SECRET }}
          WEBSTORE_REFRESH_TOKEN: ${{ secrets.WEBSTORE_REFRESH_TOKEN }}

Fix path to produced zip file
Fix path to produced zip file
