moonbitlang / moon

The build system and package manager for MoonBit
https://moonbitlang.github.io/moon/
GNU Affero General Public License v3.0
183 stars 15 forks source link

create cd using aws #270

Closed bzy-debug closed 1 month ago

peter-jerry-ye-code-review[bot] commented 1 month ago
  1. Potential Typos in Windows Paths:

    • In the Upload(Windows) step, the path for moon.exe and moonrun.exe should probably use Windows-x86_64 as the architecture, similar to the previous version. The current paths do not specify the architecture correctly:
      aws s3 cp .\target\release\moon.exe "s3://${{ secrets.AWS_BUCKET_NAME }}/bleeding-moon/$version/Windows-x86_64/"
      aws s3 cp .\target\release\moonrun.exe "s3://${{ secrets.AWS_BUCKET_NAME }}/bleeding-moonrun/$version/Windows-x86_64/"
      aws s3 cp .\target\release\moonrun.exe "s3://cli.moonbitlang.com/moon-ci/Windows-x86_64/"
  2. Missing - in Windows Command:

    • The Windows run command uses PowerShell syntax for substring operations but seems to be missing a hyphen before Substring:
      run: |
      $version = "$env:GITHUB_SHA".Substring(0, 9)

      It should be:

      run: |
      $version = "$env:GITHUB_SHA".Substring(0, 9)
  3. Environment Variable Redundancy:

    • The env blocks in both Upload(Unix) and Upload(Windows) sections repeat the same environment variables. Consider moving these to a higher level to avoid redundancy:
      env:
      AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}

      This way, the environment variables are set once for the entire job, reducing redundancy and potential for errors.