Skip to content

Commit

Permalink
Initializes project
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon committed Jul 9, 2022
0 parents commit 38200ed
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/cd.yml
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
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/Cargo.lock
/target
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true
}
11 changes: 11 additions & 0 deletions COPYING
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.
11 changes: 11 additions & 0 deletions Cargo.toml
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"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# A module for interfacing with GNU Automake

## License

MIT
6 changes: 6 additions & 0 deletions locenv-module.yml
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
21 changes: 21 additions & 0 deletions src/lib.rs
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
}

0 comments on commit 38200ed

Please sign in to comment.