-
-
Notifications
You must be signed in to change notification settings - Fork 62
120 lines (110 loc) · 3.71 KB
/
publish-release.yaml
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
116
117
118
119
120
name: Publish Release
on:
pull_request:
types: [closed]
jobs:
publish_release:
if: ${{ github.base_ref == 'main' && startsWith(github.head_ref, 'publish-release/') && github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag_name: ${{ steps.describe.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-hs
- name: Upload Packages
run: |
stack sdist
stack upload morpheus-graphql-tests
stack upload morpheus-graphql-core
stack upload morpheus-graphql-code-gen-utils
stack upload morpheus-graphql-code-gen
stack upload morpheus-graphql-app
stack upload morpheus-graphql-client
stack upload morpheus-graphql-subscriptions
stack upload morpheus-graphql-server
stack upload morpheus-graphql
env:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
- name: Describe
id: describe
run: echo "VERSION=$(hconf version)" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.describe.outputs.VERSION }}
release_name: ${{ steps.describe.outputs.VERSION }}
body: ${{ github.event.pull_request.body }}
upload_artifact:
needs: publish_release
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
- 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: ${{ needs.publish_release.outputs.upload_url }}
asset_path: morpheus.zip
asset_name: morpheus-${{ matrix.target }}.zip
asset_content_type: application/zip
test_artifact:
needs: [publish_release, upload_artifact]
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 }}
steps:
- uses: actions/checkout@v2
- name: Download and extract Artifact
run: |
curl -o morpheus.zip -LO https://github.com/${{ github.repository }}/releases/download/${{ needs.publish_release.outputs.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