HN user

techplex

535 karma

DIY Lighting NERD checkout our display Mid October - March. https://www.youtube.com/watch?v=C_Xs2mXkkBg

Mentor FIRST Robotics Team 4909 https://www.team4909.org/

Posts17
Comments65
View on HN
Windmill.dev 4 years ago

Seems like my email in the format word.other@gmail.com doesn't pass some check. I'm getting this error:

    Sql error: error returned from database: new row for relation "workspace_invite" violates check constraint "proper_email"

I often "publish" artifacts internally in github actions with the actions/upload-artifact action. https://github.com/actions/upload-artifact

//.github/workflows/main.yml

  name: Main

  on:
    push:
      branches: [ main ]
    pull_request:
      branches: [ main ]

  jobs:

    build:
      runs-on: self-hosted
      steps:
      - uses: actions/checkout@v2

      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.16

      - name: Test
        run: go test -v ./...

      - name: Build Discover Command
        run: go build -o discover cmd/discover/main.go

      - name: Upload Build Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: discover
          path: discover

For internal tooling we often publish tagged artifacts to releases on the repo using a workflow that is triggered when someone creates a release. The creation of the release makes a new tag and triggers the build.

//.github/workflows/release.yml

  name: Release

  on:
    release:
      types:
        - published

  jobs:
    build:
      runs-on: self-hosted
      env:
        GOPRIVATE: "github.com/OUR-ORG-NAME/\*"
        NAME: deploy-${{ github.event.release.tag_name }}-${{ matrix.GOOS }}-${{ matrix.GOARCH }}${{ matrix.EXTENSION }}
      strategy:
        matrix:
          GOOS: [ windows, linux, darwin ]
          GOARCH: [ amd64, 386 ]
          exclude:
            # excludes 32bit on macOS
            - GOOS: darwin
              GOARCH: 386
          include:
            # includes a new variable for windows builds
            - GOOS: windows
              EXTENSION: ".exe"
      steps:
        # Runs a single command using the runners shell
        - name: Print Info
          run: echo '${{ toJSON(github.event.release) }}'

        - uses: actions/checkout@v2

        - name: Set up Go
          uses: actions/setup-go@v2
          with:
            go-version: 1.16

        # From https://github.com/mvdan/github-actions-golang/blob/master/README.md
        - name: Configure git for private modules
          run: |
            git config --global \
            url."https://${{ secrets.GHUSER }}:${{ secrets.GHTOKEN }}@github.com".insteadOf \
            "https://github.com"
        - name: Build ${{ env.NAME }} Command
          run: |
            GOOS=${{ matrix.GOOS }} \
            GOARCH=${{ matrix.GOARCH }} \
            go build -o ${{ env.NAME }} cmd/main.go
        - name: Upload Release Asset - ${{ matrix.GOOS }} / ${{ matrix.GOARCH }}
          uses: actions/upload-release-asset@v1
          env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          with:
            upload_url: ${{ github.event.release.upload_url }}
            asset_path: ./${{ env.NAME }}
            asset_name:   ${{ env.NAME }}
            asset_content_type: application/octet-stream
edit: code formatting