Skip to content

Commit

Permalink
Add github action configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMore201 committed Jul 23, 2024
1 parent 671c74a commit 9fbda54
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on: push

jobs:
build:
name: Toolchain build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: sudo ./install-deps

- name: Build
run: ./build-toolchain

- name: Extract commit SHA
shell: bash
run: |
echo "SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo $SHORT_SHA
- name: Package
run: |
cd ./INSTALL
zip -r9 ../tricore-gcc-11.3.1-${{ env.SHORT_SHA }}-linux.zip .
cd ../INSTALL-WIN
zip -r9X ../tricore-gcc-11.3.1-${{ env.SHORT_SHA }}-win32.zip .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Toolchain packages
path: ./*.zip
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
name: Publish Release artifacts
runs-on: ubuntu-latest

steps:
- name: Download artifacts from latest workflow
uses: dawidd6/action-download-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build.yml
branch: ${{ github.event.release.target_commitish }}
workflow_conclusion: success
skip_unpack: false
13 changes: 13 additions & 0 deletions install-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

set -e

if [ ! -f /etc/lsb_release ] && [ ! -f /etc/debian_version ]
then
echo "Script is meant to install packages on Debian/Ubuntu based distributions"
echo "Pleas install dependencies manually on other distributions"
exit 1
fi

apt-get update
apt-get -y install build-essential build-essential gcc-mingw-w64 g++-mingw-w64 texinfo flex bison libmpfr-dev libgmp-dev libmpc-dev zip

0 comments on commit 9fbda54

Please sign in to comment.