-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 38200ed
Showing
9 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: CD | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, macos-11, windows-2022] | ||
include: | ||
- os: ubuntu-20.04 | ||
binary: target/release/libautomake.so | ||
suffix: linux | ||
- os: macos-11 | ||
binary: target/release/libautomake.dylib | ||
suffix: darwin | ||
- os: windows-2022 | ||
binary: target/release/automake.dll | ||
suffix: win32 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: cargo build -r | ||
- name: Upload module binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binary-${{ matrix.suffix }} | ||
path: ${{ matrix.binary }} | ||
release: | ||
name: Release | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
contents: write | ||
needs: build | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
- name: Prepare package content | ||
run: mkdir -pv package | ||
- name: Transform module definition | ||
run: | | ||
require 'yaml' | ||
mod = YAML.load_file('locenv-module.yml') | ||
mod['version'] = Integer(ENV['GITHUB_REF_NAME']) | ||
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 | ||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: package.zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, macos-11, windows-2022] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
- name: Build | ||
run: cargo build | ||
- name: Run tests | ||
run: cargo test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/Cargo.lock | ||
/target |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"files.insertFinalNewline": true, | ||
"files.trimFinalNewlines": true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Copyright 2022 Ultima Microsystems | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR | ||
A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "automake" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
locenv = "0.1" | ||
locenv-macros = "0.1" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# A module for interfacing with GNU Automake | ||
|
||
## License | ||
|
||
MIT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: automake | ||
version: -1 | ||
program: | ||
linux: libautomake.so | ||
darwin: libautomake.dylib | ||
win32: automake.dll |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use locenv::api::LuaState; | ||
use locenv::FunctionEntry; | ||
use locenv_macros::loader; | ||
use std::os::raw::c_int; | ||
|
||
const MODULE_FUNCTIONS: [FunctionEntry; 1] = [FunctionEntry { | ||
name: "setupsh", | ||
function: Some(setupsh), | ||
}]; | ||
|
||
extern "C" fn setupsh(lua: *mut LuaState) -> c_int { | ||
0 | ||
} | ||
|
||
#[loader] | ||
extern "C" fn loader(lua: *mut LuaState) -> c_int { | ||
locenv::create_table(lua, 0, 1); | ||
locenv::set_functions(lua, &MODULE_FUNCTIONS, 0); | ||
|
||
1 | ||
} |