Skip to content

Commit

Permalink
wip(ruby): Patch actions to do one step build and publish of gems
Browse files Browse the repository at this point in the history
  • Loading branch information
sighphyre committed Feb 16, 2024
1 parent c787e51 commit f90d143
Showing 1 changed file with 14 additions and 39 deletions.
53 changes: 14 additions & 39 deletions .github/workflows/build-ruby.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,19 @@ jobs:
for file in *.gem; do mv "$file" "${file%.gem}-x86_64-linux.gem"; done
working-directory: ${{ github.workspace }}

- name: Echo Built Gem Names for Linux
run: ls *.gem
working-directory: ruby-engine

- name: Upload Gem for Ubuntu
uses: actions/upload-artifact@v2
with:
name: gem-ubuntu
path: ruby-engine/*.gem
- name: Publish Gem for Linux
# if: startsWith(github.ref, 'refs/tags/')
run: |
- name: Build and Publish Gem for Linux
run: |
cd ruby-engine
gem build yggdrasil-engine.gemspec
for file in *.gem; do
mv "$file" "${file%.gem}-x86_64-linux.gem"
gem push "$file"
gem push "${file%.gem}-x86_64-linux.gem"
done
working-directory: ${{ github.workspace }}
env:
GEM_HOST_API_KEY: ${{ secrets.GEMS_PUBLISH_KEY }}


build_windows:
runs-on: windows-latest
strategy:
Expand Down Expand Up @@ -94,25 +87,17 @@ jobs:
Get-ChildItem *.gem | Rename-Item -NewName { $_.Name -replace '.gem$', '-x86_64-windows.gem' }
working-directory: ${{ github.workspace }}

- name: Echo Built Gem Names for Windows
run: Get-ChildItem *.gem | ForEach-Object { Write-Host $_.Name }
working-directory: ruby-engine

- name: Upload Gem for Windows
uses: actions/upload-artifact@v2
with:
name: gem-windows
path: ruby-engine/*.gem

- name: Publish Gem for Windows
# if: startsWith(github.ref, 'refs/tags/')
run: |
- name: Build and Publish Gem for Windows
run: |
cd ruby-engine
gem build yggdrasil-engine.gemspec
Get-ChildItem *.gem | Rename-Item -NewName { $_.Name -replace '.gem$', '-x86_64-windows.gem' }
Get-ChildItem *.gem | ForEach-Object { gem push $_.Name }
working-directory: ${{ github.workspace }}
env:
GEM_HOST_API_KEY: ${{ secrets.GEMS_PUBLISH_KEY }}


build_macos:
runs-on: macos-latest
steps:
Expand All @@ -135,24 +120,14 @@ jobs:
cp target/x86_64-apple-darwin/release/libyggdrasilffi.dylib ruby-engine/lib/x86_64-apple-darwin/
working-directory: ${{ github.workspace }}

- name: Build Gem for macOS
- name: Build and Publish Gem for macOS
run: |
cd ruby-engine
gem build yggdrasil-engine.gemspec
for file in *.gem; do mv "$file" "${file%.gem}-x86_64-macos.gem"; done
working-directory: ${{ github.workspace }}

- name: Echo Built Gem Names for MacOS
run: ls *.gem
working-directory: ruby-engine

- name: Publish Gem for MacOS
# if: startsWith(github.ref, 'refs/tags/')
run: |
gem build yggdrasil-engine.gemspec
for file in *.gem; do
mv "$file" "${file%.gem}-x86_64-macos.gem"
gem push "$file"
gem push "${file%.gem}-x86_64-macos.gem"
done
working-directory: ${{ github.workspace }}
env:
GEM_HOST_API_KEY: ${{ secrets.GEMS_PUBLISH_KEY }}

0 comments on commit f90d143

Please sign in to comment.