summaryrefslogtreecommitdiffstats
path: root/.github/workflows/onefiledist.yml
blob: 3f3b3e567e4ff777c58830a8df261513f0246567 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build
on: [push]
jobs:
  linux:
    name: Linux
    runs-on: ubuntu-16.04
    defaults:
      run:
        shell: bash
        working-directory: unix
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Prepare
        run: |
          touch generic/tclStubInit.c generic/tclOOStubInit.c
          mkdir 1dist
        working-directory: .
      - name: Configure
        run: ./configure --disable-symbols --disable-shared --enable-zipfs
      - name: Build
        run: |
          make tclsh tclzipfile
          sed -n '/^VERSION /{s/.*= /TCL_VER=/;p;q;}' < Makefile >> $GITHUB_ENV
          echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
      - name: Package
        run: |
          cat ../unix/tclsh $TCL_ZIP > tclsh${TCL_VER}_unofficial
          chmod +x tclsh${TCL_VER}_unofficial
          tar -cf tclsh${TCL_VER}_unofficial.tar tclsh${TCL_VER}_unofficial
        working-directory: 1dist
      - name: Upload
        uses: actions/upload-artifact@v2
        with:
          name: Tclsh ${{ env.TCL_VER }} Linux single-file build (unofficial)
          path: 1dist/*.tar
  macos:
    name: macOS
    runs-on: macos-latest
    defaults:
      run:
        shell: bash
        working-directory: unix
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Checkout create-dmg
        uses: actions/checkout@v2
        with:
          repository: create-dmg/create-dmg
          ref: v1.0.8
      - name: Prepare
        run: |
          touch generic/tclStubInit.c generic/tclOOStubInit.c
          mkdir 1dist
          echo "CREATE_DMG=$(cd create-dmg;pwd)/create-dmg" >> $GITHUB_ENV
        working-directory: .
      - name: Configure
        run: ./configure --disable-symbols --disable-shared --enable-zipfs
      - name: Build
        run: |
          make tclsh tclzipfile
          sed -n '/^VERSION /{s/.*= /TCL_VER=/;p;q;}' < Makefile >> $GITHUB_ENV
          echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
      - name: Package
        run: |
          mkdir contents
          cat ../unix/tclsh $TCL_ZIP > contents/tclsh${TCL_VER}_unofficial
          chmod +x contents/tclsh${TCL_VER}_unofficial
          $CREATE_DMG \
              --volname "Tcl ${{ env.TCL_VER }} (unofficial)" \
              --window-pos 200 120 \
              --window-size 800 400 \
              --app-drop-link 600 185 \
              "Tcl-${{ env.TCL_VER }}-(unofficial).dmg" \
              "contents/"
        working-directory: 1dist
      - name: Upload
        uses: actions/upload-artifact@v2
        with:
          name: Tclsh ${{ env.TCL_VER }} macOS single-file build (unofficial)
          path: 1dist/*.dmg
  win:
    name: Windows
    runs-on: windows-latest
    defaults:
      run:
        shell: bash
        working-directory: win
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Install MSYS2 and Make
        run: choco install msys2 make
      - name: Prepare
        run: |
          touch generic/tclStubInit.c generic/tclOOStubInit.c
          mkdir 1dist
        working-directory: .
      - name: Configure
        run: ./configure --disable-symbols --disable-shared --enable-zipfs
      - name: Build
        run: |
          make binaries libraries tclzipfile
          sed -n '/^VERSION /{s/.*= /TCL_VER=/;p;q;}' < Makefile >> $GITHUB_ENV
          echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV
      - name: Package
        run: |
          cat ../win/tclsh*.exe $TCL_ZIP > tclsh${TCL_VER}_unofficial.exe
        working-directory: 1dist
      - name: Upload
        uses: actions/upload-artifact@v2
        with:
          name: Tclsh ${{ env.TCL_VER }} Windows single-file build (unofficial)
          path: '1dist/*_unofficial.exe'