Add package workflow #18
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 and test | |
on: | |
push: | |
branches: [ mob ] | |
jobs: | |
create-tag: | |
runs-on: ubuntu-24.04 | |
permissions: write-all | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Create tag | |
if: github.ref == 'refs/heads/mob' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
set -eux | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
TAG="dev" | |
gh release delete $TAG --yes || true | |
git tag -d $TAG || true | |
git push origin --delete $TAG || true | |
git fetch --tags | |
git tag -l | |
git tag $TAG | |
git push origin $TAG | |
test-x86_64-linux: | |
runs-on: ubuntu-24.04 | |
permissions: write-all | |
needs: create-tag | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build and install (x86_64-linux) | |
run: ./configure --prefix=tinycc && make && make install | |
- name: Package | |
run: | | |
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on tcc-x86_64-linux.7z tinycc | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: github.ref == 'refs/heads/mob' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: "Development build" | |
tag_name: dev | |
fail_on_unmatched_files: true | |
make_latest: true | |
files: | | |
tcc-x86_64-linux.7z | |
test-aarch64-macos: | |
runs-on: macos-14 | |
timeout-minutes: 20 | |
permissions: write-all | |
needs: create-tag | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build and install (aarch64-macos) | |
run: ./configure --prefix=tinycc && make && make install | |
- name: Package | |
run: | | |
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on tcc-aarch64-macos.7z tinycc | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: github.ref == 'refs/heads/mob' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: "Development build" | |
tag_name: dev | |
fail_on_unmatched_files: true | |
make_latest: true | |
files: | | |
tcc-aarch64-macos.7z | |
test-x86_64-windows: | |
runs-on: windows-2022 | |
timeout-minutes: 20 | |
permissions: write-all | |
needs: create-tag | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build and install (x86_64-windows) | |
shell: cmd | |
run: | | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
cd win32 | |
build-tcc.bat -i tinycc -c cl | |
- name: Package | |
run: | | |
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on tcc-x86_64-windows.7z win32\tinycc | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: github.ref == 'refs/heads/mob' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: "Development build" | |
tag_name: dev | |
fail_on_unmatched_files: true | |
make_latest: true | |
files: | | |
tcc-x86_64-windows.7z | |