Skip to content

Commit

Permalink
CI: Allow build to be triggered manually.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed Nov 4, 2024
1 parent 1377ebe commit e34c259
Showing 1 changed file with 43 additions and 18 deletions.
61 changes: 43 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
release:
types:
- published
workflow_dispatch:

jobs:
source:
name: Source
runs-on: ubuntu-22.04
if: github.event_name == 'release'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
Expand All @@ -29,16 +29,15 @@ jobs:
mkdir -p natmap-${{ github.ref_name }}
git ls-files --recurse-submodules | tar c -O -T- | tar x -C natmap-${{ github.ref_name }}
echo ${REV_ID} > natmap-${{ github.ref_name }}/.version
tar caf natmap-${{ github.ref_name }}.tar.gz natmap-${{ github.ref_name }}
tar cJf natmap-${{ github.ref_name }}.tar.xz natmap-${{ github.ref_name }}
- name: Upload source
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-artifact@v4
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: natmap-${{ github.ref_name }}.tar.gz
asset_name: natmap-${{ github.ref_name }}.tar.gz
asset_content_type: application/octet-stream
name: natmap-${{ github.ref_name }}.tar.xz
path: natmap-${{ github.ref_name }}.tar.xz
if-no-files-found: error
retention-days: 1

linux:
name: Linux
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -110,15 +109,39 @@ jobs:
sudo tar xf ${{ matrix.tool }}.tar.xz -C /opt/x-tools
make CROSS_PREFIX=/opt/x-tools/${{ matrix.tool }}/bin/${{ matrix.tool }}- CFLAGS=${{ matrix.env.CFLAGS }} ENABLE_STATIC=1 -j`nproc`
- name: Upload ${{ matrix.name }}
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-artifact@v4
with:
name: natmap-linux-${{ matrix.name }}
path: bin/natmap
if-no-files-found: error
retention-days: 1

release:
name: Release
runs-on: ubuntu-22.04
needs:
- source
- linux
if: github.event_name == 'release'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download artifacts
uses: actions/download-artifact@v4
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: bin/natmap
asset_name: natmap-linux-${{ matrix.name }}
asset_content_type: application/octet-stream
path: release
pattern: "natmap-*"
merge-multiple: true
- name: Upload artifacts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for i in release/natmap-*; do
gh release upload ${{ github.event.release.tag_name }} $i
done
macos:
name: macOS
runs-on: macos-14
Expand All @@ -132,6 +155,7 @@ jobs:
- name: Build
run: |
make
android:
name: Android
runs-on: ubuntu-22.04
Expand All @@ -150,6 +174,7 @@ jobs:
- name: Build
run: |
./android-ndk-r27b/ndk-build
llvm:
name: LLVM
runs-on: ubuntu-22.04
Expand Down

0 comments on commit e34c259

Please sign in to comment.