-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automatically upload binaries for: linux, mac-os, windows (#780)
* fix: * nix * update * nix * binary.sh * ls * update publish binary * setup-hs * update binaries * generate stack config * setup * remove sh * releases * binaries * upload * Token * binary * update zip * windows latest * exe * execName * out * update * update * cd out * with bash * update * shell * -l * test os * update * update tests * artifacts * upload * checkout * update on push * binaries * dynamic url generation * generate cabal files
- Loading branch information
1 parent
611561d
commit c37d623
Showing
6 changed files
with
159 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Source Distribution | ||
inputs: | ||
ghc: | ||
description: GHC Version | ||
required: false | ||
default: latest | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
|
||
- name: generate stack config | ||
run: | | ||
npm i | ||
npm run setup ${{ inputs.ghc }} | ||
shell: bash | ||
|
||
- name: Setup Haskell | ||
uses: haskell/actions/[email protected] | ||
with: | ||
ghc-version: ${{ inputs.ghc }} | ||
enable-stack: true | ||
|
||
- name: Cache Stack | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.stack | ||
key: ${{ runner.os }}-${{ inputs.ghc }}-stack-${{ hashFiles('stack.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ inputs.ghc }}-stack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ jobs: | |
build: | ||
strategy: | ||
matrix: | ||
# "8.2.2" TODO: fix: ByteCodeLink.lookupCE | ||
ghc: ["8.4.4", "8.6.5", "8.8.3", "8.10.7", "9.0.2", "latest"] | ||
os: [ubuntu-latest] | ||
fail-fast: true | ||
|
@@ -15,29 +14,10 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
|
||
- name: Install Node | ||
run: npm i | ||
|
||
- name: setup stack config | ||
run: npm run setup ${{ matrix.ghc }} | ||
|
||
- name: Setup Haskell | ||
uses: haskell/actions/[email protected] | ||
- name: Setup | ||
uses: ./.github/actions/setup-hs | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
enable-stack: true | ||
- name: Cache Stack | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.stack | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-${{ hashFiles('stack.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.ghc }}-stack | ||
# Install & Build & Test | ||
ghc: ${{ matrix.ghc }} | ||
|
||
- name: Install dependencies | ||
run: stack build --fast --skip-ghc-check --no-terminal --test --only-dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Upload Artifacts | ||
on: | ||
release: | ||
types: [published] | ||
|
||
# thanks to: https://github.com/tweag/ormolu/blob/master/.github/workflows/binaries.yml | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: linux | ||
executable: morpheus | ||
- os: macOS-latest | ||
target: mac-os | ||
executable: morpheus | ||
- os: windows-latest | ||
target: windows | ||
executable: morpheus.exe | ||
name: Upload Artifacts for ${{ matrix.target }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: setup | ||
uses: ./.github/actions/setup-hs | ||
with: | ||
ghc: latest | ||
|
||
- name: Build Artifacts | ||
run: stack build morpheus-graphql-code-gen | ||
shell: bash | ||
|
||
- name: Prepare Artifacts | ||
run: | | ||
mkdir out | ||
cd ./out | ||
cp $(stack exec which morpheus) ./${{ matrix.executable }} | ||
7z a ../morpheus.zip . | ||
shell: bash | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: morpheus.zip | ||
asset_name: morpheus-${{ matrix.target }}.zip | ||
asset_content_type: application/octet-stream | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: linux | ||
- os: macOS-latest | ||
target: mac-os | ||
- os: windows-latest | ||
target: windows | ||
name: Test Binaries | ||
runs-on: ${{ matrix.os }} | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download and extract Artifact | ||
run: | | ||
curl -o morpheus.zip -LO https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/morpheus-${{ matrix.target }}.zip | ||
7z e morpheus.zip | ||
- name: Test CLI Commands | ||
run: | | ||
./morpheus about | ||
./morpheus build examples/code-gen | ||
./morpheus build examples/code-gen-docs | ||
./morpheus check examples/code-gen | ||
./morpheus check examples/code-gen-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters