getsentry / action-release

GitHub Action for creating a release on Sentry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Container action is only supported on Linux

alekhinen opened this issue · comments

Hello! I'm porting over my team's react native build pipeline from CircleCI to Github Actions and just discovered that this action is only supported on Linux containers.

Screen Shot 2021-05-28 at 10 05 51 AM

As a workaround, we're going to have to install sentry-cli and run the release command manually. It would be great to have this action work on macos as well!

Just set this up only to hit the same issue since I'm running on a Windows vm. To work around this I'm writing my version to a text file that gets uploaded as a build artifact, then in a second job I download that file, read the version out, and then create the release with it.

jobs:
  build:

      # ...

      - name: Write version
        run: |
          "${{ steps.build.outputs.version }}" > ./artifacts/version.txt
        shell: pwsh

      - name: Upload release version
        uses: actions/upload-artifact@v2.2.4
        with:
          name: version
          path: artifacts/version.txt

      # ...

  release:
    needs: build

    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2.3.4

      - name: Download release version
        uses: actions/download-artifact@v2.0.10
        with:
          name: version

      - name: Get release version
        id: meta
        run: |
          _version="$(cat ./version.txt)"
          echo "::set-output name=version::${_version}"

      - name: Create Sentry release
        uses: getsentry/action-release@v1.1.6
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
        with:
          environment: production
          projects: ${{ secrets.SENTRY_PROJECT }}
          version: ${{ steps.meta.outputs.version }}

Any updates here? What is the blocker to getting this running on MacOS containers? Would be much nicer to do the release creation in the same container that builds the executable instead of passing data to another job in our release workflow.

Not in the current backlog.
I'm surprised the build process does not generate the build suitable for Mac runners.

@alekhinen @xt0rted @vorporeal What specific runners are you using? Are they arm or Intel?

This would require adding a workflow that tests the action against more than ubuntu runners.

It would also probably require building targeting more than Linux Intel platform.
Here's a workflow I wrote for generating an arm64 image from an Intel runner.

Steps to reproduce:

SENTRY_ORG=sentry-test docker run --rm --platform arm64 ghcr.io/getsentry/action-release-image:latest uname -m
Unable to find image 'ghcr.io/getsentry/action-release-image:latest' locally
latest: Pulling from getsentry/action-release-image
Digest: sha256:d4985bcbd6a633b944deaa56d4b2c91c9a8d24be5d783876be1f7e3fb0914c4f
Status: Image is up to date for ghcr.io/getsentry/action-release-image:latest
WARNING: image with reference ghcr.io/getsentry/action-release-image was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64
docker: Error response from daemon: image with reference ghcr.io/getsentry/action-release-image:latest was found but does not match the specified platform: wanted darwin/arm64, actual: linux/amd64.
See 'docker run --help'.

I'm using Intel Windows runners.

The action is already javascript based so it's easy to switch from targeting docker to js, it's 2 lines in action.yml. The cli dependency will probably be an issue though as that looks to have native binaries. I'm not really sure how js actions work with dependencies like that, or if there's any docs on the best way to handle them.

I will see if I can look into this by September.
I will be creating a v2 release to upgrade to the latest sentry cli.

commented

Could you please specify this in the README.md? It's making people waste time setting this up only to find out by a console error.

Could you please specify this in the README.md? It's making people waste time setting this up only to find out by a console error.

Good idea. Would this be clear enough? #104

commented

That's great. Thanks for adding it!

is there a timeline for adding mac support? I'd like to use it for our fastlane setup.

Closing this as "completed" is a weird move since it's definitely not completed.