summaryrefslogtreecommitdiff
path: root/.github/workflows/linux.yml
blob: 5368a7061b1346a05d25e1a37cc7b80527fb1cd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Linux

on:
  pull_request:
  push:
  release:
    types: [published]

jobs:
  build:
    runs-on: ubuntu-latest
    concurrency:
        group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Linux
        cancel-in-progress: true
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - name: prepare local xmake
        run: cp -rf . ../xmake-source
      - uses: xmake-io/github-action-setup-xmake@v1
        with:
          xmake-version: local#../xmake-source
      - uses: dlang-community/setup-dlang@v1
        with:
          compiler: dmd-latest
      - uses: little-core-labs/[email protected]
        id: tagName

      - name: Prepare
        run: |
          sudo apt update
          sudo apt install -y ruby ruby-dev rubygems build-essential llvm libc++-dev
          sudo apt install -y libgl1-mesa-dev libglu1-mesa-dev
          clang --version
          xrepo install -y zig

      - name: Tests
        run: |
          xmake lua -v -D tests/run.lua
          xrepo --version

      - name: Artifact
        run: |
          cd core
          xrepo env -b zig xmake f --embed=y --toolchain=zig --cross=x86_64-linux-gnu.2.29 -c
          xmake
          mkdir ../artifacts
          cp build/xmake ../artifacts/xmake-bundle
          cd ..
      - uses: actions/upload-artifact@v4
        with:
          name: xmake-bundle.linux.x86_64
          path: artifacts/xmake-bundle

      - name: Publish
        if: github.event.action == 'published'
        env:
          PPA_GPG_PRIKEY_2C0C68C9: ${{ secrets.PPA_GPG_PRIKEY_2C0C68C9 }}
        run: |
          # upload ubuntu/ppa
          sudo apt install -y dh-make rng-tools devscripts lintian
          echo "$PPA_GPG_PRIKEY_2C0C68C9" > ppa_gpg.key
          gpg --import ppa_gpg.key
          scripts/makeppa noble # 24.04
          scripts/makeppa mantic # 23.10
          scripts/makeppa lunar # 23.04
          scripts/makeppa kinetic # 22.10
          scripts/makeppa jammy # 22.04
          scripts/makeppa focal # 20.04
          scripts/makeppa bionic # 18.04
          scripts/makeppa xenial # 16.04
          scripts/makeppa trusty # 14.04

      - name: Publish bundle binary
        if: github.event.action == 'published'
        uses: actions/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ github.event.release.upload_url }}
          asset_path: artifacts/xmake-bundle
          asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.linux.x86_64
          asset_content_type: application/zip