Migrate to the production account S3 bucket (#205) #118
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
push: | |
tags: | |
- v* | |
- pre-rel-* | |
env: | |
automatic_pckg_name_prefix: 'gamerhash-ai-facade-windows-w-automatic' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
os: | |
- ubuntu | |
- windows | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet publish --configuration Release | |
- name: Collect binaries | |
run: | | |
dotnet run --project Golem.Package --configuration Release build --dont-clean --dll-file-patterns *.dll --dll-dir ${{ github.workspace }}/Golem/bin/Release/net7.0/publish | |
- name: Pack | |
id: pack | |
shell: bash | |
env: | |
OS_NAME: ${{ matrix.os }} | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
bash .ci/pack-build.sh | |
VERSION="${GITHUB_REF##*/}" | |
VERSION="${VERSION#pre-rel-}" | |
# Export version e.g. "v0.1.5-RC1" | |
echo "::set-output name=version::${VERSION}" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
releases/gamerhash-ai-facade-* | |
prerelease: ${{ startsWith(github.ref, 'refs/tags/pre-rel-v') }} | |
- name: Release Automatic | |
if: matrix.os == 'windows' | |
shell: pwsh | |
env: | |
PKG_NAME: ${{ env.automatic_pckg_name_prefix }}_${{ steps.pack.outputs.version }}.zip | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
.\scripts\automatic.ps1 ` | |
-compress 1 ` | |
-cleanup 1 | |
Write-S3Object ` | |
-BucketName modelserve-gamerhash-facade ` | |
-AccessKey $env:AWS_ACCESS_KEY_ID ` | |
-SecretKey $env:AWS_SECRET_ACCESS_KEY ` | |
-File "bin\dist_package.zip" ` | |
-Key "packages\$($env:PKG_NAME)" ` | |
-Force |