Skip to content

Commit

Permalink
Updates module definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Jul 10, 2022
1 parent 38200ed commit faa48ca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
55 changes: 35 additions & 20 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
include:
- os: ubuntu-20.04
binary: target/release/libautomake.so
suffix: linux
artifact: amd64-linux
- os: macos-11
binary: target/release/libautomake.dylib
suffix: darwin
artifact: amd64-darwin
- os: windows-2022
binary: target/release/automake.dll
suffix: win32
artifact: amd64-win32
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Upload module binary
uses: actions/upload-artifact@v3
with:
name: binary-${{ matrix.suffix }}
name: ${{ matrix.artifact }}
path: ${{ matrix.binary }}
release:
name: Release
Expand All @@ -39,32 +39,47 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Download Linux binary
uses: actions/download-artifact@v3
with:
name: amd64-linux
path: amd64-linux
- name: Download macOS binary
uses: actions/download-artifact@v3
with:
name: amd64-darwin
path: amd64-darwin
- name: Download Windows binary
uses: actions/download-artifact@v3
with:
name: amd64-win32
path: amd64-win32
- name: Prepare package content
run: mkdir -pv package
run: |
mkdir -pv package
mv -v amd64-linux/libautomake.so package/amd64-linux.so
mv -v amd64-darwin/libautomake.dylib package/amd64-darwin.dylib
mv -v amd64-win32/automake.dll package/amd64-win32.dll
- name: Transform module definition
run: |
require 'yaml'
mod = YAML.load_file('locenv-module.yml')
mod['version'] = Integer(ENV['GITHUB_REF_NAME'])
mod['program'] = {
'linux' => {
'amd64' => 'amd64-linux.so'
},
'darwin' => {
'amd64' => 'amd64-darwin.dylib'
},
'win32' => {
'amd64' => 'amd64-win32.dll'
}
}
File.open('package/locenv-module.yml', 'w') { |f| f.write mod.to_yaml.gsub("---\n", '') }
shell: ruby {0}
- name: Download Linux binary
uses: actions/download-artifact@v3
with:
name: binary-linux
path: package
- name: Download macOS binary
uses: actions/download-artifact@v3
with:
name: binary-darwin
path: package
- name: Download Windows binary
uses: actions/download-artifact@v3
with:
name: binary-win32
path: package
- name: Create package
run: zip -r ../package.zip *
working-directory: package
Expand Down
5 changes: 0 additions & 5 deletions locenv-module.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
name: automake
version: -1
program:
linux: libautomake.so
darwin: libautomake.dylib
win32: automake.dll

0 comments on commit faa48ca

Please sign in to comment.