-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (116 loc) · 4.16 KB
/
build-and-release.yml
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Build and Release
on:
push:
branches: [ main ]
pull_request:
branches: []
jobs:
build:
runs-on: ubuntu-22.04
env:
IAS_SPID: ${{ secrets.IAS_SPID }}
SGX_ENABLED: ${{ secrets.SGX_ENABLED }}
IAS_API_KEY: ${{ secrets.IAS_API_KEY }}
PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }}
ACCOUNT_MNEMONIC: ${{ secrets.ACCOUNT_MNEMONIC }}
PINATA_API_SECRET: ${{ secrets.PINATA_API_SECRET }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Install build-essential, curl, git, wget, and Docker
run: |
sudo apt-get update
sudo apt-get install -y build-essential curl git wget
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
echo "Installed build-essential, curl, git, wget, and Docker"
- name: Setup Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: 1.51.0
override: true
components: rustc, cargo
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install Yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Update permissions
run: (cd ./packages/gramine/bazk-build && chmod +x *)
- name: Build app
run: yarn gramine build-app-dist
- name: Build manifest
run: yarn gramine build-manifest
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: ./packages/gramine/dist/
- name: Zip the dist folder
run: cd ./packages/gramine/bazk-build && zip -r ../../../dist.zip dist
- name: Get the current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M')"
- name: Create new release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.date.outputs.date }}
release_name: "Release: ${{ steps.date.outputs.date }}"
draft: false
prerelease: false
body: "Bazk new release at ${{ steps.date.outputs.date }}"
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip
# release:
# needs: build
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Download build artifact
# uses: actions/download-artifact@v2
# with:
# name: dist
# - name: Prepare release
# run: zip -r dist.zip dist
# - name: Get the current date
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M')"
# - name: Create new release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ steps.date.outputs.date }}
# release_name: "Release: ${{ steps.date.outputs.date }}"
# draft: false
# prerelease: false
# body: "Bazk new release at ${{ steps.date.outputs.date }}"
# - name: Upload Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./dist
# asset_name: dist.zip
# asset_content_type: application/zip