From b6e9aef0b482a0e0a2cb557a9415cd7d0e119d1e Mon Sep 17 00:00:00 2001 From: LKedward Date: Wed, 18 Nov 2020 14:51:24 +0000 Subject: Add: CI to upload binaries on release --- .github/workflows/release_binaries.yml | 133 +++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 .github/workflows/release_binaries.yml diff --git a/.github/workflows/release_binaries.yml b/.github/workflows/release_binaries.yml new file mode 100644 index 0000000..d855c39 --- /dev/null +++ b/.github/workflows/release_binaries.yml @@ -0,0 +1,133 @@ +name: Release binaries + +on: release + +jobs: + Build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + gcc_v: [9] # Version of GFortran we want to use. + include: + - os: ubuntu-latest + STACK_CACHE: "/home/runner/.stack/" + STACK_CACHE_VERSION: "" + BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" + - os: macos-latest + STACK_CACHE: | + /Users/runner/.stack/snapshots + /Users/runner/.stack/setup-exe-src + STACK_CACHE_VERSION: "v2" + BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" + - os: windows-latest + STACK_CACHE: | + C:\Users\runneradmin\AppData\Roaming\stack + C:\Users\runneradmin\AppData\Local\Programs\stack + STACK_CACHE_VERSION: "v2" + BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe + + env: + FC: gfortran + GCC_V: ${{ matrix.gcc_v }} + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Install GFortran macOS + if: contains(matrix.os, 'macos') + run: | + ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran + which gfortran-${GCC_V} + which gfortran + + - name: Install GFortran Linux + if: contains(matrix.os, 'ubuntu') + run: | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ + --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ + --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} + + - name: Get Time + id: time + uses: nanzm/get-time-action@v1.0 + with: + format: 'YYYY-MM' + + - name: Setup github actions cache + id: cache + uses: actions/cache@v2 + with: + path: ${{matrix.STACK_CACHE}} + key: ${{ runner.os }}-${{ steps.time.outputs.time }}${{matrix.STACK_CACHE_VERSION}} + + - name: Build Haskell fpm + run: | + cd bootstrap + stack build + stack install + + - name: put fpm to PATH (macOS) + if: contains(matrix.os, 'macos') + run: | + cp /Users/runner/.local/bin/fpm /usr/local/bin + + - name: put fpm to PATH (Windows) + if: contains(matrix.os, 'windows') + run: | + copy "C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe" "C:\Program Files\Git\usr\bin" + + - name: put fpm to PATH (Linux) + if: contains(matrix.os, 'ubuntu') + run: | + sudo cp /home/runner/.local/bin/fpm /usr/local/bin + + - name: Run tests on Haskell fpm + run: | + cd bootstrap + stack test + + - name: Build and run Fortran fpm (Linux / macOS) + if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') + run: | + ci/run_tests.sh + + - name: Build and run Fortran fpm (Windows) + if: contains(matrix.os, 'windows') + run: | + ci\run_tests.bat + + - name: Check that fpm --version matches release tag + if: contains(matrix.os, 'ubuntu') + run: fpm run -- "--version" | grep $(git ls-remote --tags ./ | cut -d/ -f3) + + - name: Stage file for upload (Linux / macOS) + if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') + run: fpm run --runner cp -- fpm-${{ matrix.os }}-x86_64-debug + + - name: Stage file for upload (Windows) + if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') + shell: cmd + run: fpm run --runner copy -- fpm-${{ matrix.os }}-x86_64-debug + + - name: Upload dev trunk binary release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: fpm-${{ matrix.os }}-x86_64-debug + asset_name: fpm-${{ matrix.os }}-x86_64-debug + tag: ${{ github.ref }} + overwrite: true + prerelease: true + + - name: Upload dev trunk binary release (bootstrap fpm) + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.BOOTSTRAP_FILE }} + asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64-debug + tag: ${{ github.ref }} + overwrite: true + prerelease: true \ No newline at end of file -- cgit v1.2.3 From cf0576774bb504bac4b0648bb05fbcb2b90d11a0 Mon Sep 17 00:00:00 2001 From: LKedward Date: Wed, 18 Nov 2020 15:09:38 +0000 Subject: Fix: binary_release ci --- .github/workflows/release_binaries.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release_binaries.yml b/.github/workflows/release_binaries.yml index d855c39..e7a54b6 100644 --- a/.github/workflows/release_binaries.yml +++ b/.github/workflows/release_binaries.yml @@ -6,7 +6,6 @@ jobs: Build: runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] gcc_v: [9] # Version of GFortran we want to use. @@ -101,22 +100,28 @@ jobs: - name: Check that fpm --version matches release tag if: contains(matrix.os, 'ubuntu') - run: fpm run -- "--version" | grep $(git ls-remote --tags ./ | cut -d/ -f3) + run: | + cd fpm + fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -d/ -f3) - name: Stage file for upload (Linux / macOS) if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') - run: fpm run --runner cp -- fpm-${{ matrix.os }}-x86_64-debug + run: | + cd fpm + fpm run --runner cp -- fpm-${{ matrix.os }}-x86_64-debug - name: Stage file for upload (Windows) - if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') + if: contains(matrix.os, 'windows') shell: cmd - run: fpm run --runner copy -- fpm-${{ matrix.os }}-x86_64-debug + run: | + cd fpm + fpm run --runner copy -- fpm-${{ matrix.os }}-x86_64-debug - name: Upload dev trunk binary release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm-${{ matrix.os }}-x86_64-debug + file: fpm/fpm-${{ matrix.os }}-x86_64-debug asset_name: fpm-${{ matrix.os }}-x86_64-debug tag: ${{ github.ref }} overwrite: true -- cgit v1.2.3 From 254a08ec19875564cc8149b2713e2e6f34844330 Mon Sep 17 00:00:00 2001 From: LKedward Date: Wed, 18 Nov 2020 15:44:19 +0000 Subject: Move release workflow into existing CI to reuse build/test workflow --- .github/workflows/CI.yml | 50 +++++++++++- .github/workflows/release_binaries.yml | 138 --------------------------------- 2 files changed, 49 insertions(+), 139 deletions(-) delete mode 100644 .github/workflows/release_binaries.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 03fcf84..22aa6e5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,6 +1,6 @@ name: CI -on: [push, pull_request] +on: [push, pull_request, release] env: CI: "ON" # We can detect this in the build system and other vendors implement it @@ -23,16 +23,22 @@ jobs: - os: ubuntu-latest STACK_CACHE: "/home/runner/.stack/" STACK_CACHE_VERSION: "" + BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" + XSUFFIX: "" - os: macos-latest STACK_CACHE: | /Users/runner/.stack/snapshots /Users/runner/.stack/setup-exe-src STACK_CACHE_VERSION: "v2" + BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" + XSUFFIX: "" - os: windows-latest STACK_CACHE: | C:\Users\runneradmin\AppData\Roaming\stack C:\Users\runneradmin\AppData\Local\Programs\stack STACK_CACHE_VERSION: "v2" + BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe + XSUFFIX: ".exe" env: FC: gfortran @@ -104,3 +110,45 @@ jobs: if: contains(matrix.os, 'windows') run: | ci\run_tests.bat + + # ----- Upload binaries if creating a release ----- + - name: Check that fpm --version matches release tag + if: github.event_name == 'release' && contains(matrix.os, 'ubuntu') + run: | + cd fpm + fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -d/ -f3) + + - name: Stage file for upload (Linux / macOS) + if: github.event_name == 'release' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) + run: | + cd fpm + fpm run --runner cp -- fpm-${{ matrix.os }}-x86_64-debug + + - name: Stage file for upload (Windows) + if: github.event_name == 'release' && contains(matrix.os, 'windows') + shell: cmd + run: | + cd fpm + fpm run --runner copy -- fpm-${{ matrix.os }}-x86_64-debug + + - name: Upload dev trunk binary release + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: fpm/fpm-${{ matrix.os }}-x86_64-debug + asset_name: fpm-${{ matrix.os }}-x86_64-debug${{ matrix.XSUFFIX }} + tag: ${{ github.ref }} + overwrite: true + prerelease: true + + - name: Upload dev trunk binary release (bootstrap fpm) + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.BOOTSTRAP_FILE }} + asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64-debug${{ matrix.XSUFFIX }} + tag: ${{ github.ref }} + overwrite: true + prerelease: true \ No newline at end of file diff --git a/.github/workflows/release_binaries.yml b/.github/workflows/release_binaries.yml deleted file mode 100644 index e7a54b6..0000000 --- a/.github/workflows/release_binaries.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: Release binaries - -on: release - -jobs: - Build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - gcc_v: [9] # Version of GFortran we want to use. - include: - - os: ubuntu-latest - STACK_CACHE: "/home/runner/.stack/" - STACK_CACHE_VERSION: "" - BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" - - os: macos-latest - STACK_CACHE: | - /Users/runner/.stack/snapshots - /Users/runner/.stack/setup-exe-src - STACK_CACHE_VERSION: "v2" - BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" - - os: windows-latest - STACK_CACHE: | - C:\Users\runneradmin\AppData\Roaming\stack - C:\Users\runneradmin\AppData\Local\Programs\stack - STACK_CACHE_VERSION: "v2" - BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe - - env: - FC: gfortran - GCC_V: ${{ matrix.gcc_v }} - - steps: - - name: Checkout code - uses: actions/checkout@v1 - - - name: Install GFortran macOS - if: contains(matrix.os, 'macos') - run: | - ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran - which gfortran-${GCC_V} - which gfortran - - - name: Install GFortran Linux - if: contains(matrix.os, 'ubuntu') - run: | - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ - --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ - --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} - - - name: Get Time - id: time - uses: nanzm/get-time-action@v1.0 - with: - format: 'YYYY-MM' - - - name: Setup github actions cache - id: cache - uses: actions/cache@v2 - with: - path: ${{matrix.STACK_CACHE}} - key: ${{ runner.os }}-${{ steps.time.outputs.time }}${{matrix.STACK_CACHE_VERSION}} - - - name: Build Haskell fpm - run: | - cd bootstrap - stack build - stack install - - - name: put fpm to PATH (macOS) - if: contains(matrix.os, 'macos') - run: | - cp /Users/runner/.local/bin/fpm /usr/local/bin - - - name: put fpm to PATH (Windows) - if: contains(matrix.os, 'windows') - run: | - copy "C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe" "C:\Program Files\Git\usr\bin" - - - name: put fpm to PATH (Linux) - if: contains(matrix.os, 'ubuntu') - run: | - sudo cp /home/runner/.local/bin/fpm /usr/local/bin - - - name: Run tests on Haskell fpm - run: | - cd bootstrap - stack test - - - name: Build and run Fortran fpm (Linux / macOS) - if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') - run: | - ci/run_tests.sh - - - name: Build and run Fortran fpm (Windows) - if: contains(matrix.os, 'windows') - run: | - ci\run_tests.bat - - - name: Check that fpm --version matches release tag - if: contains(matrix.os, 'ubuntu') - run: | - cd fpm - fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -d/ -f3) - - - name: Stage file for upload (Linux / macOS) - if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') - run: | - cd fpm - fpm run --runner cp -- fpm-${{ matrix.os }}-x86_64-debug - - - name: Stage file for upload (Windows) - if: contains(matrix.os, 'windows') - shell: cmd - run: | - cd fpm - fpm run --runner copy -- fpm-${{ matrix.os }}-x86_64-debug - - - name: Upload dev trunk binary release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm/fpm-${{ matrix.os }}-x86_64-debug - asset_name: fpm-${{ matrix.os }}-x86_64-debug - tag: ${{ github.ref }} - overwrite: true - prerelease: true - - - name: Upload dev trunk binary release (bootstrap fpm) - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ matrix.BOOTSTRAP_FILE }} - asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64-debug - tag: ${{ github.ref }} - overwrite: true - prerelease: true \ No newline at end of file -- cgit v1.2.3 From e34b4ce8a0e1c49fd286b819e10025e7c918fce1 Mon Sep 17 00:00:00 2001 From: LKedward Date: Wed, 18 Nov 2020 15:59:27 +0000 Subject: Compile release binaries statically --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 22aa6e5..9106fe2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -122,14 +122,14 @@ jobs: if: github.event_name == 'release' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) run: | cd fpm - fpm run --runner cp -- fpm-${{ matrix.os }}-x86_64-debug + fpm run --flag --static --runner cp -- fpm-${{ matrix.os }}-x86_64-debug - name: Stage file for upload (Windows) if: github.event_name == 'release' && contains(matrix.os, 'windows') shell: cmd run: | cd fpm - fpm run --runner copy -- fpm-${{ matrix.os }}-x86_64-debug + fpm run --flag --static --runner copy -- fpm-${{ matrix.os }}-x86_64-debug - name: Upload dev trunk binary release if: github.event_name == 'release' -- cgit v1.2.3 From 026f1f634803f1d081f6c06eafdc7ccc8556d1fd Mon Sep 17 00:00:00 2001 From: LKedward Date: Wed, 18 Nov 2020 16:26:04 +0000 Subject: Update: binary release CI --- .github/workflows/CI.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9106fe2..0191b37 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,6 +25,7 @@ jobs: STACK_CACHE_VERSION: "" BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" XSUFFIX: "" + RELEASE_CMD: "fpm run --flag --static --runner cp" - os: macos-latest STACK_CACHE: | /Users/runner/.stack/snapshots @@ -32,6 +33,7 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" XSUFFIX: "" + RELEASE_CMD: "fpm run --runner cp" - os: windows-latest STACK_CACHE: | C:\Users\runneradmin\AppData\Roaming\stack @@ -39,6 +41,7 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe XSUFFIX: ".exe" + RELEASE_CMD: "fpm run --flag --static --runner copy" env: FC: gfortran @@ -118,20 +121,14 @@ jobs: cd fpm fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -d/ -f3) - - name: Stage file for upload (Linux / macOS) + - name: Stage release files for upload if: github.event_name == 'release' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) run: | cd fpm - fpm run --flag --static --runner cp -- fpm-${{ matrix.os }}-x86_64-debug - - - name: Stage file for upload (Windows) - if: github.event_name == 'release' && contains(matrix.os, 'windows') - shell: cmd - run: | - cd fpm - fpm run --flag --static --runner copy -- fpm-${{ matrix.os }}-x86_64-debug + ${{ matrix.RELEASE_CMD }} -- fpm-${{ matrix.os }}-x86_64-debug + ${{ matrix.RELEASE_CMD }} --release -- fpm-${{ matrix.os }}-x86_64-release - - name: Upload dev trunk binary release + - name: Upload debug binary if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 with: @@ -141,8 +138,19 @@ jobs: tag: ${{ github.ref }} overwrite: true prerelease: true - - - name: Upload dev trunk binary release (bootstrap fpm) + + - name: Upload release binary + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: fpm/fpm-${{ matrix.os }}-x86_64-release + asset_name: fpm-${{ matrix.os }}-x86_64-release${{ matrix.XSUFFIX }} + tag: ${{ github.ref }} + overwrite: true + prerelease: true + + - name: Upload bootstrap fpm binary if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 with: -- cgit v1.2.3 From 302d54a4f7ecdd2d2c9e0f1cb445efca7424bc22 Mon Sep 17 00:00:00 2001 From: LKedward Date: Thu, 19 Nov 2020 10:13:13 +0000 Subject: Fix compile flags for release binaries --- .github/workflows/CI.yml | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0191b37..eb0e9db 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,7 +25,7 @@ jobs: STACK_CACHE_VERSION: "" BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" XSUFFIX: "" - RELEASE_CMD: "fpm run --flag --static --runner cp" + RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner cp" - os: macos-latest STACK_CACHE: | /Users/runner/.stack/snapshots @@ -33,7 +33,7 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" XSUFFIX: "" - RELEASE_CMD: "fpm run --runner cp" + RELEASE_CMD: "fpm run --flag -g --flag -fbacktrace --flag -O3 --runner cp" - os: windows-latest STACK_CACHE: | C:\Users\runneradmin\AppData\Roaming\stack @@ -41,7 +41,7 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe XSUFFIX: ".exe" - RELEASE_CMD: "fpm run --flag --static --runner copy" + RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner copy" env: FC: gfortran @@ -122,30 +122,18 @@ jobs: fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -d/ -f3) - name: Stage release files for upload - if: github.event_name == 'release' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) + if: github.event_name == 'release' run: | cd fpm - ${{ matrix.RELEASE_CMD }} -- fpm-${{ matrix.os }}-x86_64-debug - ${{ matrix.RELEASE_CMD }} --release -- fpm-${{ matrix.os }}-x86_64-release + ${{ matrix.RELEASE_CMD }} -- fpm-${{ matrix.os }}-x86_64 - name: Upload debug binary if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm/fpm-${{ matrix.os }}-x86_64-debug - asset_name: fpm-${{ matrix.os }}-x86_64-debug${{ matrix.XSUFFIX }} - tag: ${{ github.ref }} - overwrite: true - prerelease: true - - - name: Upload release binary - if: github.event_name == 'release' - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm/fpm-${{ matrix.os }}-x86_64-release - asset_name: fpm-${{ matrix.os }}-x86_64-release${{ matrix.XSUFFIX }} + file: fpm/fpm-${{ matrix.os }}-x86_64 + asset_name: fpm-${{ matrix.os }}-x86_64${{ matrix.XSUFFIX }} tag: ${{ github.ref }} overwrite: true prerelease: true @@ -156,7 +144,7 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ${{ matrix.BOOTSTRAP_FILE }} - asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64-debug${{ matrix.XSUFFIX }} + asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64${{ matrix.XSUFFIX }} tag: ${{ github.ref }} overwrite: true prerelease: true \ No newline at end of file -- cgit v1.2.3 From e4c0b1219668afe31298b8ae639830feac6e3c91 Mon Sep 17 00:00:00 2001 From: LKedward Date: Thu, 19 Nov 2020 11:42:07 +0000 Subject: Update: README with binary download link. --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c6458f..6948648 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,12 @@ To report a bug report or suggest a feature, please read our ## Getting started -### Install Haskell +### Binary download +`x86-64` binaries are available [to download](https://github.com/fortran-lang/fpm/releases) for Windows, MacOS and Linux. + +### Build from source + +#### Install Haskell To install **Haskell Stack**, follow these [instructions](https://docs.haskellstack.org/en/stable/install_and_upgrade/), @@ -25,14 +30,14 @@ users without superuser (admin) permissions should follow the [manual installation](https://docs.haskellstack.org/en/stable/install_and_upgrade/#manual-download_2) procedure. -### Download this repository +#### Download this repository ```bash $ git clone https://github.com/fortran-lang/fpm $ cd fpm/ ``` -### Build and test fpm +#### Build and test fpm Bootstrap *fpm* using: -- cgit v1.2.3 From bfe258e7c36c46dcc829aa5e30971b22e715943a Mon Sep 17 00:00:00 2001 From: LKedward Date: Thu, 19 Nov 2020 12:06:12 +0000 Subject: Restrict github actions release triggers --- .github/workflows/CI.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eb0e9db..a65bad2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,6 +1,10 @@ name: CI -on: [push, pull_request, release] +on: + push: + pull_request: + release: + types: [published] env: CI: "ON" # We can detect this in the build system and other vendors implement it @@ -119,7 +123,7 @@ jobs: if: github.event_name == 'release' && contains(matrix.os, 'ubuntu') run: | cd fpm - fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -d/ -f3) + fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -dv -f2) - name: Stage release files for upload if: github.event_name == 'release' @@ -127,7 +131,7 @@ jobs: cd fpm ${{ matrix.RELEASE_CMD }} -- fpm-${{ matrix.os }}-x86_64 - - name: Upload debug binary + - name: Upload fpm binary if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 with: -- cgit v1.2.3 From 87e1db5045b0f58a7207ea040770da53548d3ba1 Mon Sep 17 00:00:00 2001 From: LKedward Date: Thu, 19 Nov 2020 14:33:17 +0000 Subject: Check release version on all platforms --- .github/workflows/CI.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a65bad2..d57e02a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,6 +29,7 @@ jobs: STACK_CACHE_VERSION: "" BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" XSUFFIX: "" + CHECK_VERSION_CMD: grep $(echo ${{ github.ref }} | cut -dv -f2) RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner cp" - os: macos-latest STACK_CACHE: | @@ -37,6 +38,7 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" XSUFFIX: "" + CHECK_VERSION_CMD: grep $(echo ${{ github.ref }} | cut -dv -f2) RELEASE_CMD: "fpm run --flag -g --flag -fbacktrace --flag -O3 --runner cp" - os: windows-latest STACK_CACHE: | @@ -45,6 +47,7 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe XSUFFIX: ".exe" + CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",("${{ github.ref }}" -Split "v")[1],"*")) {echo $_} else {Throw} } RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner copy" env: @@ -120,10 +123,10 @@ jobs: # ----- Upload binaries if creating a release ----- - name: Check that fpm --version matches release tag - if: github.event_name == 'release' && contains(matrix.os, 'ubuntu') + if: github.event_name == 'release' run: | cd fpm - fpm run -- "--version" | grep $(echo ${{ github.ref }} | cut -dv -f2) + fpm run -- "--version" | ${{ matrix.CHECK_VERSION_CMD }} - name: Stage release files for upload if: github.event_name == 'release' -- cgit v1.2.3 From 08864fb757a22d7a03af57ef1f23d2b68f2cbf52 Mon Sep 17 00:00:00 2001 From: LKedward Date: Fri, 20 Nov 2020 16:09:22 +0000 Subject: Update: naming of binary releases --- .github/workflows/CI.yml | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d57e02a..6897675 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,8 +29,9 @@ jobs: STACK_CACHE_VERSION: "" BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" XSUFFIX: "" - CHECK_VERSION_CMD: grep $(echo ${{ github.ref }} | cut -dv -f2) - RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner cp" + GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 + CHECK_VERSION_CMD: grep $(cat fpm_version) + RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" - os: macos-latest STACK_CACHE: | /Users/runner/.stack/snapshots @@ -38,8 +39,9 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" XSUFFIX: "" - CHECK_VERSION_CMD: grep $(echo ${{ github.ref }} | cut -dv -f2) - RELEASE_CMD: "fpm run --flag -g --flag -fbacktrace --flag -O3 --runner cp" + GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 + CHECK_VERSION_CMD: grep $(cat fpm_version) + RELEASE_CMD: "fpm run --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" - os: windows-latest STACK_CACHE: | C:\Users\runneradmin\AppData\Roaming\stack @@ -47,8 +49,9 @@ jobs: STACK_CACHE_VERSION: "v2" BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe XSUFFIX: ".exe" - CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",("${{ github.ref }}" -Split "v")[1],"*")) {echo $_} else {Throw} } - RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner copy" + GET_VERSION_CMD: ("${{ github.ref }}" -Split "v")[1] + CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} } + RELEASE_CMD: fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) env: FC: gfortran @@ -126,32 +129,36 @@ jobs: if: github.event_name == 'release' run: | cd fpm + ${{ matrix.GET_VERSION_CMD }} > fpm_version fpm run -- "--version" | ${{ matrix.CHECK_VERSION_CMD }} - name: Stage release files for upload if: github.event_name == 'release' run: | cd fpm - ${{ matrix.RELEASE_CMD }} -- fpm-${{ matrix.os }}-x86_64 + ${{ matrix.RELEASE_CMD }} + + - name: Make executable + if: github.event_name == 'release' && (contains(matrix.os, 'linux') || contains(matrix.os, 'macos')) + run: chmod u+x fpm/fpm-v* - name: Upload fpm binary if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm/fpm-${{ matrix.os }}-x86_64 - asset_name: fpm-${{ matrix.os }}-x86_64${{ matrix.XSUFFIX }} + file: fpm/fpm-v* + file_glob: true tag: ${{ github.ref }} overwrite: true - prerelease: true - - name: Upload bootstrap fpm binary - if: github.event_name == 'release' - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ matrix.BOOTSTRAP_FILE }} - asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64${{ matrix.XSUFFIX }} - tag: ${{ github.ref }} - overwrite: true - prerelease: true \ No newline at end of file + # - name: Upload bootstrap fpm binary + # if: github.event_name == 'release' + # uses: svenstaro/upload-release-action@v2 + # with: + # repo_token: ${{ secrets.GITHUB_TOKEN }} + # file: ${{ matrix.BOOTSTRAP_FILE }} + # asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64${{ matrix.XSUFFIX }} + # tag: ${{ github.ref }} + # overwrite: true + # prerelease: true \ No newline at end of file -- cgit v1.2.3 From 09de7d3d362f0e054499c939fb07e96cccfbeef3 Mon Sep 17 00:00:00 2001 From: LKedward Date: Fri, 20 Nov 2020 16:57:00 +0000 Subject: Update: naming of bootstrap binary release --- .github/workflows/CI.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6897675..da8f683 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,31 +27,28 @@ jobs: - os: ubuntu-latest STACK_CACHE: "/home/runner/.stack/" STACK_CACHE_VERSION: "" - BOOTSTRAP_FILE: "/home/runner/.local/bin/fpm" - XSUFFIX: "" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" + BOOTSTRAP_RELEASE_CMD: cp /home/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-linux-x86_64 - os: macos-latest STACK_CACHE: | /Users/runner/.stack/snapshots /Users/runner/.stack/setup-exe-src STACK_CACHE_VERSION: "v2" - BOOTSTRAP_FILE: "/Users/runner/.local/bin/fpm" - XSUFFIX: "" GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2 CHECK_VERSION_CMD: grep $(cat fpm_version) RELEASE_CMD: "fpm run --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" + BOOTSTRAP_RELEASE_CMD: cp /Users/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-macos-x86_64 - os: windows-latest STACK_CACHE: | C:\Users\runneradmin\AppData\Roaming\stack C:\Users\runneradmin\AppData\Local\Programs\stack STACK_CACHE_VERSION: "v2" - BOOTSTRAP_FILE: C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe - XSUFFIX: ".exe" GET_VERSION_CMD: ("${{ github.ref }}" -Split "v")[1] CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} } RELEASE_CMD: fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) + BOOTSTRAP_RELEASE_CMD: copy C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe (-join("fpm-bootstrap-v",(Get-Content fpm_version),"-windows-x86_64.exe")) env: FC: gfortran @@ -137,9 +134,10 @@ jobs: run: | cd fpm ${{ matrix.RELEASE_CMD }} + ${{ matrix.BOOTSTRAP_RELEASE_CMD }} - name: Make executable - if: github.event_name == 'release' && (contains(matrix.os, 'linux') || contains(matrix.os, 'macos')) + if: github.event_name == 'release' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) run: chmod u+x fpm/fpm-v* - name: Upload fpm binary @@ -152,13 +150,12 @@ jobs: tag: ${{ github.ref }} overwrite: true - # - name: Upload bootstrap fpm binary - # if: github.event_name == 'release' - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.GITHUB_TOKEN }} - # file: ${{ matrix.BOOTSTRAP_FILE }} - # asset_name: fpm-bootstrap-${{ matrix.os }}-x86_64${{ matrix.XSUFFIX }} - # tag: ${{ github.ref }} - # overwrite: true - # prerelease: true \ No newline at end of file + - name: Upload bootstrap fpm binary + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: fpm/fpm-bootstrap-v* + file_glob: true + tag: ${{ github.ref }} + overwrite: true \ No newline at end of file -- cgit v1.2.3 From bf73a2a043b43d21c1f45131191a14287dfc3d0f Mon Sep 17 00:00:00 2001 From: LKedward Date: Fri, 20 Nov 2020 18:00:46 +0000 Subject: Add: hashes to binary releases --- .github/workflows/CI.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index da8f683..20ff6ce 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -31,6 +31,8 @@ jobs: CHECK_VERSION_CMD: grep $(cat fpm_version) RELEASE_CMD: "fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-linux-x86_64" BOOTSTRAP_RELEASE_CMD: cp /home/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-linux-x86_64 + HASH_CMD: ls fpm-*|xargs -i{} sh -c 'sha256sum $1 > $1.sha256' -- {} + - os: macos-latest STACK_CACHE: | /Users/runner/.stack/snapshots @@ -40,6 +42,8 @@ jobs: CHECK_VERSION_CMD: grep $(cat fpm_version) RELEASE_CMD: "fpm run --flag -g --flag -fbacktrace --flag -O3 --runner cp -- fpm-v$(cat fpm_version)-macos-x86_64" BOOTSTRAP_RELEASE_CMD: cp /Users/runner/.local/bin/fpm fpm-bootstrap-v$(cat fpm_version)-macos-x86_64 + HASH_CMD: ls fpm-*|xargs -I{} sh -c 'shasum -a 256 $1 > $1.sha256' -- {} + - os: windows-latest STACK_CACHE: | C:\Users\runneradmin\AppData\Roaming\stack @@ -49,6 +53,7 @@ jobs: CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} } RELEASE_CMD: fpm run --flag --static --flag -g --flag -fbacktrace --flag -O3 --runner copy -- (-join("fpm-v",(Get-Content fpm_version),"-windows-x86_64.exe")) BOOTSTRAP_RELEASE_CMD: copy C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe (-join("fpm-bootstrap-v",(Get-Content fpm_version),"-windows-x86_64.exe")) + HASH_CMD: Get-ChildItem -File -Filter "fpm-*" | Foreach-Object {echo (Get-FileHash -Algorithm SHA256 $PSItem | Select-Object hash | Format-Table -HideTableHeaders | Out-String) > (-join($PSItem,".sha256"))} env: FC: gfortran @@ -135,27 +140,18 @@ jobs: cd fpm ${{ matrix.RELEASE_CMD }} ${{ matrix.BOOTSTRAP_RELEASE_CMD }} + ${{ matrix.HASH_CMD }} - name: Make executable if: github.event_name == 'release' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) run: chmod u+x fpm/fpm-v* - - name: Upload fpm binary - if: github.event_name == 'release' - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm/fpm-v* - file_glob: true - tag: ${{ github.ref }} - overwrite: true - - - name: Upload bootstrap fpm binary + - name: Upload assets if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: fpm/fpm-bootstrap-v* + file: fpm/fpm-* file_glob: true tag: ${{ github.ref }} overwrite: true \ No newline at end of file -- cgit v1.2.3 From 846d4e50fd5e9c6fe7538409d9f4ae3722d0eca7 Mon Sep 17 00:00:00 2001 From: LKedward Date: Sat, 21 Nov 2020 10:07:07 +0000 Subject: Update: README with executable permission text for binaries --- .github/workflows/CI.yml | 4 ---- README.md | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 20ff6ce..8165ded 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -142,10 +142,6 @@ jobs: ${{ matrix.BOOTSTRAP_RELEASE_CMD }} ${{ matrix.HASH_CMD }} - - name: Make executable - if: github.event_name == 'release' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')) - run: chmod u+x fpm/fpm-v* - - name: Upload assets if: github.event_name == 'release' uses: svenstaro/upload-release-action@v2 diff --git a/README.md b/README.md index 6948648..d131b84 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ To report a bug report or suggest a feature, please read our ### Binary download `x86-64` binaries are available [to download](https://github.com/fortran-lang/fpm/releases) for Windows, MacOS and Linux. +__Note:__ On Linux and MacOS, you will need to enable executable permission before you can use the binary. + +_e.g._ `$ chmod u+x fpm-v0.1.0-linux-x86_64` + ### Build from source #### Install Haskell -- cgit v1.2.3