Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from alvinseville7cf:master #4

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 42 additions & 46 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,81 +6,77 @@ on:

workflow_dispatch:

jobs:
build:
env:
BUILD_FOLDER_PATH: bin

jobs:
netcorebuild:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Mono Build
- name: DotNET Core Setup
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'

- name: DotNET Core Build
run: |
chmod +x build.sh && ./build.sh
chmod +x netcorebuild.sh && ./netcorebuild.sh "$BUILD_FOLDER_PATH"

tar -cf solution.tar LaboratoryWork.sln Project

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: program
path: main.exe
name: solution
path: "${{ env.BUILD_FOLDER_PATH }}/solution.tar"
retention-days: 1

lint:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v2

- name: Markdown Check
run: |
sudo chown -R $(whoami) /usr/local/bin /usr/local/lib /usr/local/include /usr/local/share
npm install -g markdownlint-cli
markdownlint *.md
- name: Shell Check
if: always()
run: |
sudo apt-get install shellcheck
shellcheck *.sh

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: program
- name: CSharp Check
if: always()
run: |
sudo apt update
sudo apt-get install gendarme
gendarme -- *.exe

publish:
runs-on: ubuntu-latest
needs: lint
needs: netcorebuild

steps:
- uses: actions/checkout@v2

- name: Download Artifacts
- name: Download Build Artifacts
uses: actions/download-artifact@v2
with:
name: program
name: solution
path: ${{ env.BUILD_FOLDER_PATH }}

- name: Unarchive Artifacts
run: |
cd "$BUILD_FOLDER_PATH"
tar -xf solution.tar
rm -f solution.tar

- name: Convert Flowchart
run: |
sudo apt install snapd
sudo snap install drawio
drawio -x -o flowchart.pdf flowchart.drawio
sudo apt update
sudo apt-get install -y libappindicator3-1

sudo apt -y install wget
wget https://github.com/jgraph/drawio-desktop/releases/download/v12.3.2/draw.io-amd64-12.3.2.deb
sudo dpkg -i draw.io-amd64-12.3.2.deb
sudo apt -y -f install

export DISPLAY=:1
xvfb-run -a drawio -a -x -o "$BUILD_FOLDER_PATH/flowchart.pdf" flowchart.drawio --no-sandbox --headless --disable-gpu

- name: Archive
run: |
tar -cf release.tar main.exe flowchart.pdf

cd "$BUILD_FOLDER_PATH"
tar -cf release.tar *
- name: Environment Variable Setup
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Publish to GitHub
- name: Publish Build to GitHub
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "${{ env.RELEASE_VERSION }} Build"
files: release.tar
files: ${{ env.BUILD_FOLDER_PATH }}/release.tar
25 changes: 18 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: master

workflow_dispatch:

env:
BUILD_FOLDER_PATH: bin

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -25,10 +26,20 @@ jobs:
name: program
path: main.exe
retention-days: 1


netcorebuild:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: NET Core Build
run: |
chmod +x netcorebuild.sh && ./netcorebuild.sh "$BUILD_FOLDER_PATH"

lint:
runs-on: ubuntu-latest
needs: build
needs: [build, netcorebuild]

steps:
- uses: actions/checkout@v2
Expand All @@ -41,16 +52,16 @@ jobs:
- name: Shell Check
if: always()
run: |
sudo apt-get install shellcheck
shellcheck *.sh

- name: Download Artifacts
if: always()
uses: actions/download-artifact@v2
with:
name: program
- name: CSharp Check
if: always()
run: |
sudo apt update
sudo apt-get update
sudo apt-get install gendarme
gendarme -- *.exe
Loading