Create portable build #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
strategy: | |
matrix: | |
version: | |
- "3.16.1" | |
- "3.16.0" | |
os: | |
- "ubuntu-22.04" | |
- "ubuntu-20.04" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update apt index | |
run: sudo apt update -y -qq | |
- name: Install dependency packages | |
run: | | |
sudo apt install -y -qq --no-install-recommends \ | |
build-essential \ | |
bison \ | |
flex \ | |
libssl-dev \ | |
pkg-config \ | |
libpcre3-dev \ | |
libwww-perl \ | |
libgnutls28-dev | |
- name: Download Source | |
run: | | |
wget -O - "https://codeload.github.com/inspircd/inspircd/tar.gz/v${{matrix.version}}" | tar xz | |
- name: Build Inspircd ${{matrix.version}} | |
run: bash install.sh ${{matrix.version}} | |
- name: Archive Artifacts | |
working-directory: run | |
run: tar cvzf ../inspircd.${{matrix.version}}.${{matrix.os}}.tar.gz ./* | |
- name: Upload archives | |
uses: actions/upload-artifact@v4 | |
with: | |
name: inspircd.${{matrix.version}}.${{matrix.os}}.tar.gz | |
path: inspircd*.tar.gz | |
if-no-files-found: error | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H%M%S')" | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Create Release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{steps.date.outputs.date}}" | |
prerelease: false | |
title: "Build ${{steps.date.outputs.date}}" | |
files: | | |
inspircd*/inspircd*.tar.gz |