Skip to content

Commit

Permalink
Add auto package github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Sep 5, 2021
1 parent e49f43f commit 9ccf28d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "package"

on:
push:
branches:
- "master"

jobs:
package:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Package
shell: bash
run: make package
- name: Adjust variables
shell: bash
id: pkgvars
run: |
case "${{matrix.os}}" in
windows-latest)
pkgfile=`ls pkg/*.zip`
;;
*)
pkgfile=`ls pkg/*.tar.xz`
;;
esac
echo "::set-output name=pkgfile::$pkgfile";
- name: Upload pre release
uses: ncipollo/release-action@v1
with:
name: Latest Nelua in development
tag: latest
artifacts: ${{steps.pkgvars.outputs.pkgfile}}
token: ${{secrets.GITHUB_TOKEN}}
prerelease: true
allowUpdates: true
body:
Precompiled Nelua binary package rebuilt at every new commit in master branch.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
CFLAGS: -Wextra -Werror
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Show C compiler information
run: ${{matrix.cc}} -v
- name: Compile
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ uninstall:

# Utilities
TAR_XZ=tar cfJ
ZIP_DIR=zip -qr9
ZIP_DIR=7z a

# Package name
ifeq ($(SYS), Windows)
Expand Down Expand Up @@ -325,12 +325,12 @@ ifeq ($(SYS), Windows)
$(INSTALL_EXE) nelua-lua.exe "$(PKGDIR)/$(PKGNAME)/nelua-lua.exe"
$(INSTALL_EXE) nelua.bat "$(PKGDIR)/$(PKGNAME)/nelua.bat"
$(RM_FILE) "$(PKGDIR)/$(PKGNAME).zip"
$(ZIP_DIR) "$(PKGDIR)/$(PKGNAME).zip" "$(PKGDIR)/$(PKGNAME)"
cd $(PKGDIR); $(ZIP_DIR) "$(PKGNAME).zip" "$(PKGNAME)"
else
$(INSTALL_EXE) nelua-lua "$(PKGDIR)/$(PKGNAME)/nelua-lua"
$(INSTALL_EXE) nelua "$(PKGDIR)/$(PKGNAME)/nelua"
$(RM_FILE) "$(PKGDIR)/$(PKGNAME).tar.xz"
$(TAR_XZ) "$(PKGDIR)/$(PKGNAME).tar.xz" "$(PKGDIR)/$(PKGNAME)"
cd $(PKGDIR); $(TAR_XZ) "$(PKGNAME).tar.xz" "$(PKGNAME)"
endif

package-versioned:
Expand Down

0 comments on commit 9ccf28d

Please sign in to comment.