workflows/tag: also upload "noi2" version for Darwin #15
Workflow file for this run
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: Release | |
"on": | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
container: alpine:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install prerequisites | |
timeout-minutes: 10 | |
run: | | |
apk add --no-cache clang musl-dev binutils xz nodejs mingw-w64-gcc | |
- name: static compilation with clang/musl [no iTerm2 palettes] | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -o ansi2html-noi2 -flto -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c src/iterm2_color_schemes/ansi_color_palette.c | |
- name: test minimal conversion [no iTerm2 palettes] | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html-noi2 -p vga | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html-noi2 -b -p vga | |
echo | |
- name: static compilation with clang/musl [with iTerm2 palettes] | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -DITERM2_COLOR_SCHEMES -flto -o ansi2html -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c src/iterm2_color_schemes/ansi_color_palette.c | |
- name: test minimal conversion [with iTerm2 palettes] | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html -p i2_laser | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html -b -p i2_laser | |
echo | |
- name: static compilation [no iTerm2 palettes] with mingw32-w64 | |
timeout-minutes: 2 | |
run: | | |
x86_64-w64-mingw32-cc -O2 -flto -o ansi2html-noi2.exe -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c | |
- name: static compilation [with iTerm2 palettes] with mingw32-w64 | |
timeout-minutes: 2 | |
run: | | |
x86_64-w64-mingw32-cc -O2 -DITERM2_COLOR_SCHEMES -flto -o ansi2html.exe -static -Wl,-strip-all -Wl,-static src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c src/iterm2_color_schemes/ansi_color_palette.c | |
- name: compress binaries | |
timeout-minutes: 1 | |
run: | | |
xz --compress --stdout ansi2html > ansi2html-Linux-x86_64-musl.xz | |
xz --compress --stdout ansi2html-noi2 > ansi2html-noi2-Linux-x86_64-musl.xz | |
xz --compress --stdout ansi2html-noi2.exe > ansi2html-noi2-Windows-x86_64-mingw32.xz | |
xz --compress --stdout ansi2html.exe > ansi2html-Windows-x86_64-mingw32.xz | |
- name: show sizes | |
timeout-minutes: 1 | |
run: | | |
ls -laS ansi2html* | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html-Linux-x86_64-musl.xz | |
path: ansi2html-Linux-x86_64-musl.xz | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html-noi2-Linux-x86_64-musl.xz | |
path: ansi2html-noi2-Linux-x86_64-musl.xz | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html-noi2-Windows-x86_64-mingw32.xz | |
path: ansi2html-noi2-Windows-x86_64-mingw32.xz | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html-Windows-x86_64-mingw32.xz | |
path: ansi2html-Windows-x86_64-mingw32.xz | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html-noi2.exe | |
path: ansi2html-noi2.exe | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html.exe | |
path: ansi2html.exe | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
arch: [x86_64, arm64] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Build and compress for ${{matrix.arch}} [no iTerm2 palettes]" | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -target ${{matrix.arch}}-apple-darwin -o ansi2html-noi2 -flto src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c | |
- name: "Test minimal conversion for ${{matrix.arch}} [no iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html-noi2 -p vga | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html-noi2 -b -p vga | |
echo | |
- name: "Compress for ${{matrix.arch}} [no iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
xz --compress --stdout ansi2html-noi2 > ansi2html-noi2-Darwin-${{matrix.arch}}.xz | |
cp ansi2html-noi2 ansi2html-noi2-Darwin-${{matrix.arch}} | |
- name: "Build for ${{matrix.arch}} [with iTerm2 palettes]" | |
timeout-minutes: 2 | |
run: | | |
clang -O2 -DITERM2_COLOR_SCHEMES -target ${{matrix.arch}}-apple-darwin -o ansi2html -flto src/ansi2html.c src/main.c src/structs/ansi_color_palette.c src/structs/ansi_color_type.c src/structs/ansi_fg_or_bg.c src/iterm2_color_schemes/ansi_color_palette.c | |
- name: "Test minimal conversion for ${{matrix.arch}} [with iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
printf '\e[0;31mred\e[0;1;31mbold red\e[0m' | ./ansi2html -p vga | |
echo | |
printf '\e[0;31mred\e[0;1;31mbright red\e[0m' | ./ansi2html -b -p vga | |
echo | |
- name: "Compress for ${{matrix.arch}} [with iTerm2 palettes]" | |
timeout-minutes: 1 | |
run: | | |
xz --compress --stdout ansi2html > ansi2html-Darwin-${{matrix.arch}}.xz | |
cp ansi2html ansi2html-Darwin-${{matrix.arch}} | |
- name: show sizes | |
timeout-minutes: 1 | |
run: | | |
ls -laS ansi2html* | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html-Darwin-${{matrix.arch}}.xz | |
path: ansi2html-Darwin-${{matrix.arch}}.xz | |
- uses: actions/upload-artifact@master | |
with: | |
name: ansi2html-noi2-Darwin-${{matrix.arch}}.xz | |
path: ansi2html-noi2-Darwin-${{matrix.arch}}.xz | |
release: | |
needs: [build-linux, build-macos] | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url}} | |
steps: | |
- id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
upload: | |
needs: [release] | |
strategy: | |
matrix: | |
file: ['ansi2html-Linux-x86_64-musl.xz', 'ansi2html-noi2-Linux-x86_64-musl.xz', 'ansi2html-noi2-Windows-x86_64-mingw32.xz', 'ansi2html-Windows-x86_64-mingw32.xz', 'ansi2html-noi2.exe', 'ansi2html.exe', 'ansi2html-noi2-Darwin-x86_64.xz', 'ansi2html-Darwin-x86_64.xz', 'ansi2html-noi2-Darwin-arm64.xz', 'ansi2html-Darwin-arm64.xz'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@master | |
with: | |
name: ${{ matrix.file }} | |
path: . | |
- uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./${{ matrix.file }} | |
asset_name: ${{ matrix.file }} | |
asset_content_type: application/x-xz |