From fc553a3ea1d03db6f403d77152f27239bc8cd422 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 25 Nov 2020 00:41:24 +0000 Subject: Experimental branch: building single file distributions --- .github/workflows/onefiledist.yml | 102 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .github/workflows/onefiledist.yml diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml new file mode 100644 index 0000000..1c0b72f --- /dev/null +++ b/.github/workflows/onefiledist.yml @@ -0,0 +1,102 @@ +name: Build +on: [push] +jobs: + linux: + name: Linux + runs-on: ubuntu-20.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: 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 }} macOS single-file build (unofficial) + path: 1dist/*.tar + 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 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 ../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' -- cgit v0.12 From cada5eb9bd3970ea301a1f4f00c0dd541e7c9015 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 25 Nov 2020 09:13:55 +0000 Subject: Name of target is different --- .github/workflows/onefiledist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 1c0b72f..55cda01 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -88,7 +88,7 @@ jobs: run: ./configure --disable-symbols --disable-shared --enable-zipfs - name: Build run: | - make tclsh tclzipfile + 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 -- cgit v0.12 From 49ad442ac6b8cd1cbb23405c6098f7393fb6da53 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 25 Nov 2020 11:16:46 +0000 Subject: Switch to older Ubuntu so that we build with older glibc. Thanks to morganw for testing. --- .github/workflows/onefiledist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 55cda01..205673b 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -3,7 +3,7 @@ on: [push] jobs: linux: name: Linux - runs-on: ubuntu-20.04 + runs-on: ubuntu-16.04 defaults: run: shell: bash -- cgit v0.12 From 005227c53d0c7a0ed39198673b0938c88b1513d5 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 26 Nov 2020 20:09:11 +0000 Subject: Try to use a .dmg for macOS distribution --- .github/workflows/onefiledist.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 205673b..3f3b3e5 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -44,10 +44,16 @@ jobs: 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 @@ -58,15 +64,22 @@ jobs: 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 + 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/*.tar + path: 1dist/*.dmg win: name: Windows runs-on: windows-latest -- cgit v0.12 From 8c7898b5d20bdb61b808f3da8856859ebe6deec7 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 27 Nov 2020 09:58:46 +0000 Subject: Better version ID, trying to track down weird macOS problem --- .github/workflows/onefiledist.yml | 45 +++++++++++++++++++++++---------------- tools/addVerToFile.tcl | 9 ++++++++ 2 files changed, 36 insertions(+), 18 deletions(-) create mode 100755 tools/addVerToFile.tcl diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 3f3b3e5..f077861 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -7,7 +7,6 @@ jobs: defaults: run: shell: bash - working-directory: unix steps: - name: Checkout uses: actions/checkout@v2 @@ -15,24 +14,27 @@ jobs: run: | touch generic/tclStubInit.c generic/tclOOStubInit.c mkdir 1dist + echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV working-directory: . - name: Configure run: ./configure --disable-symbols --disable-shared --enable-zipfs + working-directory: unix - name: Build run: | make tclsh tclzipfile - sed -n '/^VERSION /{s/.*= /TCL_VER=/;p;q;}' < Makefile >> $GITHUB_ENV + make shell SCRIPT="$VER_PATH $GITHUB_ENV" echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV + working-directory: unix - 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 + chmod +x tclsh${TCL_PATCHLEVEL}_unofficial + tar -cf tclsh${TCL_PATCHLEVEL}_unofficial.tar tclsh${TCL_PATCHLEVEL}_unofficial working-directory: 1dist - name: Upload uses: actions/upload-artifact@v2 with: - name: Tclsh ${{ env.TCL_VER }} Linux single-file build (unofficial) + name: Tclsh ${{ env.TCL_PATCHLEVEL }} Linux single-file build (unofficial) path: 1dist/*.tar macos: name: macOS @@ -40,7 +42,6 @@ jobs: defaults: run: shell: bash - working-directory: unix steps: - name: Checkout uses: actions/checkout@v2 @@ -51,34 +52,40 @@ jobs: ref: v1.0.8 - name: Prepare run: | - touch generic/tclStubInit.c generic/tclOOStubInit.c + echo "::group::Listing configuration" + find . -ls || true + echo "::endgroup::" mkdir 1dist + touch generic/tclStubInit.c generic/tclOOStubInit.c || true + echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV echo "CREATE_DMG=$(cd create-dmg;pwd)/create-dmg" >> $GITHUB_ENV - working-directory: . - name: Configure run: ./configure --disable-symbols --disable-shared --enable-zipfs + working-directory: unix - name: Build run: | make tclsh tclzipfile - sed -n '/^VERSION /{s/.*= /TCL_VER=/;p;q;}' < Makefile >> $GITHUB_ENV + make shell SCRIPT="$VER_PATH $GITHUB_ENV" + echo "TCL_BIN=`pwd`/tclsh" >> $GITHUB_ENV echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV + working-directory: unix - name: Package run: | mkdir contents - cat ../unix/tclsh $TCL_ZIP > contents/tclsh${TCL_VER}_unofficial - chmod +x contents/tclsh${TCL_VER}_unofficial + cat $TCL_BIN $TCL_ZIP > contents/tclsh${TCL_PATCHLEVEL}_unofficial + chmod +x contents/tclsh${TCL_PATCHLEVEL}_unofficial $CREATE_DMG \ - --volname "Tcl ${{ env.TCL_VER }} (unofficial)" \ + --volname "Tcl ${{ env.TCL_PATCHLEVEL }} (unofficial)" \ --window-pos 200 120 \ --window-size 800 400 \ --app-drop-link 600 185 \ - "Tcl-${{ env.TCL_VER }}-(unofficial).dmg" \ + "Tcl-${{ env.TCL_PATCHLEVEL }}-(unofficial).dmg" \ "contents/" working-directory: 1dist - name: Upload uses: actions/upload-artifact@v2 with: - name: Tclsh ${{ env.TCL_VER }} macOS single-file build (unofficial) + name: Tclsh ${{ env.TCL_PATCHLEVEL }} macOS single-file build (unofficial) path: 1dist/*.dmg win: name: Windows @@ -86,7 +93,6 @@ jobs: defaults: run: shell: bash - working-directory: win steps: - name: Checkout uses: actions/checkout@v2 @@ -95,21 +101,24 @@ jobs: - name: Prepare run: | touch generic/tclStubInit.c generic/tclOOStubInit.c + echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV mkdir 1dist working-directory: . - name: Configure run: ./configure --disable-symbols --disable-shared --enable-zipfs + working-directory: win - name: Build run: | make binaries libraries tclzipfile - sed -n '/^VERSION /{s/.*= /TCL_VER=/;p;q;}' < Makefile >> $GITHUB_ENV + make shell SCRIPT="$VER_PATH $GITHUB_ENV" echo "TCL_ZIP=`pwd`/`echo libtcl*.zip`" >> $GITHUB_ENV + working-directory: win - name: Package run: | - cat ../win/tclsh*.exe $TCL_ZIP > tclsh${TCL_VER}_unofficial.exe + cat ../win/tclsh*.exe $TCL_ZIP > tclsh${TCL_PATCHLEVEL}_unofficial.exe working-directory: 1dist - name: Upload uses: actions/upload-artifact@v2 with: - name: Tclsh ${{ env.TCL_VER }} Windows single-file build (unofficial) + name: Tclsh ${{ env.TCL_PATCHLEVEL }} Windows single-file build (unofficial) path: '1dist/*_unofficial.exe' diff --git a/tools/addVerToFile.tcl b/tools/addVerToFile.tcl new file mode 100755 index 0000000..bfc39e2 --- /dev/null +++ b/tools/addVerToFile.tcl @@ -0,0 +1,9 @@ +#!/usr/bin/env tclsh +if {$argc < 1} { + error "need a filename argument" +} +lassign $argv filename +set f [open $filename a] +puts $f "TCL_VERSION=[info tclversion]" +puts $f "TCL_PATCHLEVEL=[info patchlevel]" +close $f -- cgit v0.12 From 0cb78052e48dae9b266b3a8291a1d5c65b1e2487 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 27 Nov 2020 18:07:05 +0000 Subject: That's the best we can do without entering the morass that is signing/notarization on macOS; Windows now uses the right version IDs --- .github/workflows/onefiledist.yml | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index f077861..0fb6ba5 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -1,4 +1,4 @@ -name: Build +name: Build Binaries on: [push] jobs: linux: @@ -27,7 +27,7 @@ jobs: working-directory: unix - name: Package run: | - cat ../unix/tclsh $TCL_ZIP > tclsh${TCL_VER}_unofficial + cat ../unix/tclsh $TCL_ZIP > tclsh${TCL_PATCHLEVEL}_unofficial chmod +x tclsh${TCL_PATCHLEVEL}_unofficial tar -cf tclsh${TCL_PATCHLEVEL}_unofficial.tar tclsh${TCL_PATCHLEVEL}_unofficial working-directory: 1dist @@ -50,11 +50,9 @@ jobs: with: repository: create-dmg/create-dmg ref: v1.0.8 + path: create-dmg - name: Prepare run: | - echo "::group::Listing configuration" - find . -ls || true - echo "::endgroup::" mkdir 1dist touch generic/tclStubInit.c generic/tclOOStubInit.c || true echo "VER_PATH=$(cd tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV @@ -74,12 +72,21 @@ jobs: mkdir contents cat $TCL_BIN $TCL_ZIP > contents/tclsh${TCL_PATCHLEVEL}_unofficial chmod +x contents/tclsh${TCL_PATCHLEVEL}_unofficial + cat > contents/README.txt <> $GITHUB_ENV working-directory: win - name: Package run: | - cat ../win/tclsh*.exe $TCL_ZIP > tclsh${TCL_PATCHLEVEL}_unofficial.exe + cat ../win/tclsh*.exe $TCL_ZIP > combined.exe + working-directory: 1dist + - name: Get Exact Version + run: | + ./combined.exe $VER_PATH $GITHUB_ENV + working-directory: 1dist + - name: Set Executable Name + run: | + mv combined.exe tclsh${TCL_PATCHLEVEL}_unofficial.exe working-directory: 1dist - name: Upload uses: actions/upload-artifact@v2 -- cgit v0.12