on:
  push:
    tags:
    - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Upload Release Assets

jobs:
  build:
    name: Upload Release Assets
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
      - name: Generate build files
        uses: thatisuday/go-cross-build@v1.0.2
        with:
            platforms: 'linux/amd64, linux/ppc64le, darwin/amd64, darwin/arm64, windows/amd64'
            package: 'cmd/godotenv'
            name: 'godotenv'
            compress: 'true'
            dest: 'dist'
      - name: Publish Binaries
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          release_name: Release ${{ github.ref }}
          tag: ${{ github.ref }}
          file: dist/*
          file_glob: true
          overwrite: true
