Skip to content

build

build #247

Workflow file for this run

name: build
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 4'
workflow_dispatch:
inputs:
tag:
description: 'Tag'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: ci.sh
run: docker run -e CI -w /root/loksh -v `pwd`:/root/loksh ghcr.io/dimkr/loksh/ci-container:latest ./ci.sh
- name: Cleanup
if: github.event_name == 'workflow_dispatch'
run: |
sudo rm -rf build build-* dst
cp -r . /tmp/loksh
rm -rf /tmp/loksh/.github /tmp/loksh/Dockerfile /tmp/loksh/ci.sh /tmp/loksh/.git /tmp/loksh/.gitmodules /tmp/loksh/subprojects/lolibc/ci.sh /tmp/loksh/subprojects/lolibc/.github /tmp/loksh/subprojects/lolibc/.git
tar -C /tmp -c loksh | xz -9 > src.tar.xz
mv /tmp/loksh /tmp/loksh-${{ github.event.inputs.tag }}
tar -C /tmp -c loksh-${{ github.event.inputs.tag }} | xz -9 > loksh-${{ github.event.inputs.tag }}.tar.xz
- name: Create release
if: github.event_name == 'workflow_dispatch'
id: create_release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
files: loksh-${{ github.event.inputs.tag }}.tar.xz