Skip to content

Commit

Permalink
Agregando script para release
Browse files Browse the repository at this point in the history
Este cambio hace que se cree un release cada vez que se empuje a master.
  • Loading branch information
lhchavez committed Sep 5, 2020
1 parent 5f83285 commit 39a7838
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ jobs:
- name: Run Webdriver tests
run: python3 -m pytest test/ --browser=firefox --browser=chrome

- name: Build C++ karel
run: |
sudo apt-get install llvm
(cd cpp && make karel)
- name: Run karel tests
run: (cd cpp && make test)

lint:
runs-on: ubuntu-20.04

Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release

on:
push:
tags:
- v*

jobs:

release:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Get the version
id: get-version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}

- name: Install dependencies
run: |
npm install
sudo apt-get -y install llvm
- name: Build CLI karel
run: |
npm run build:bundle
tar cJf dist/karel.js.tar.xz '--transform=s/dist\///' dist/*.js dist/*.node
- name: Build distributable .zip
run: |
zip --recurse-paths dist/karel.zip \
cmd/ css/ gramaticas/ img/ js/ lib/ manual/ LICENSE ayuda.html \
sandbox.html README.md index.html
- name: Build C++ karel
run: |
(cd cpp && make karel)
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get-version.outputs.version }}
release_name: ${{ steps.get-version.outputs.version }}
draft: false
prerelease: false

- name: Upload karel.zip Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./dist/karel.zip
asset_name: karel.zip
asset_content_type: application/octet-stream

- name: Upload karel.js.tar.xz Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./dist/karel.js.tar.xz
asset_name: karel.js.tar.xz
asset_content_type: application/octet-stream

- name: Upload karel Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./cpp/karel
asset_name: karel
asset_content_type: application/octet-stream
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ karel-distrib.min.js
test/.cache/
test/results/
test/**/*.png

cpp/sol.kx
cpp/karel
10 changes: 7 additions & 3 deletions cpp/test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash

for problem in ../test/problems/*; do
set -e

ROOT="$(git rev-parse --show-toplevel)"

for problem in "${ROOT}/test/problems/"*; do
echo $(basename "${problem}")
../cmd/kareljs compile "${problem}/sol.txt" -o sol.kx || die
"${ROOT}/cmd/kareljs" compile "${problem}/sol.txt" -o "${ROOT}/cpp/sol.kx"
for casename in "${problem}/cases"/*.in; do
./karel sol.kx < "${casename}" | diff -Naurw --ignore-blank-lines "${casename%.in}.out" -
"${ROOT}/cpp/karel" "${ROOT}/cpp/sol.kx" < "${casename}" | diff -Naurw --ignore-blank-lines "${casename%.in}.out" -
done
done
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "karel",
"version": "1.0.0",
"version": "1.0.1",
"description": "Compilador y evaluador de Karel en javascript",
"main": "js/index.js",
"scripts": {
Expand Down

0 comments on commit 39a7838

Please sign in to comment.