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

added automatic build and upload of artifacts #177

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
132 changes: 132 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Release CI

on:
push:
tags:
- "v*"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to match the tags for which to make releases? They are named trurl-* now...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This automation is triggered only when you push a git tag, in my case I pushed v0.6.0, it's a standard way in gh actions, but you can modify as you want... It makes sense to me, as this way the binaries are created just on a new release, not always


jobs:
build-ubuntu:
runs-on: ubuntu-latest
name: "Ubuntu Build"

strategy:
matrix:
build:
- name: default
install_packages: valgrind
test: test-memory
- name: clang sanitizers
install_packages: clang
test: test
make_opts: >
CC=clang
CFLAGS="-fsanitize=address,undefined,signed-integer-overflow -Wformat -Werror=format-security -Werror=array-bounds -g"
LDFLAGS="-fsanitize=address,undefined,signed-integer-overflow -g"
steps:
- uses: actions/checkout@v3

- name: install libcurl
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev ${{ matrix.build.install_packages }}
- name: code style check
run: make checksrc

- name: make
run: make ${{ matrix.build.make_opts }}

- name: sanity test
run: ./trurl -v

- name: test
run: make ${{matrix.build.test}}

- name: rename
run: mv trurl trurl-ubuntu

- name: artifacts
uses: actions/upload-artifact@v3
with:
name: Ubuntu
path: ./trurl-ubuntu

build-cygwin:
runs-on: cygwin-latest
name: "Cygwin Build"

steps:
- uses: actions/checkout@v3

- name: install cygwin
uses: cygwin/cygwin-install-action@master
with:
packages: curl, libcurl-devel, libcurl4, make, gcc-core, python39

- name: make
run: make

- name: sanity test
run: ./trurl -v

- name: test
run: make test

- name: rename
run: mv trurl.EXE trurl-cygwin.exe

- name: artifacts
uses: actions/upload-artifact@v3
with:
name: Cygwin
path: ./trurl-cygwin.exe

build-macos:
runs-on: macos-latest
name: "MacOS Build"

steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: make
run: make

- name: sanity test
run: ./trurl -v

- name: test
run: make test

- name: rename
run: mv trurl trurl-macos

- name: artifacts
uses: actions/upload-artifact@v3
with:
name: Macos
path: ./trurl-macos

tagged-release:
name: "Tagged Release"
runs-on: ubuntu-latest
permissions: write-all
needs: [build-ubuntu, build-cygwin, build-macos]

steps:
- uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: ls -R

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
./Ubuntu/trurl-ubuntu
./Cygwin/trurl-cygwin.exe
./Macos/trurl-macos