Skip to content

Commit 14d5786

Browse files
Merge pull request #2 from Connoropolous/ci
Create release.yml
2 parents d2880c3 + 9524c35 commit 14d5786

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

.github/nix.conf

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
substituters = https://cache.nixos.org/ https://cache.holo.host/
2+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE= cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ=

.github/workflows/release.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.*
7+
8+
# on:
9+
# push:
10+
# branches: [ sprout ]
11+
# pull_request:
12+
# branches: [ sprout ]
13+
14+
15+
jobs:
16+
# the create-release would be used once we want to create a specific release based on if the commit has a tag
17+
create-release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: taiki-e/create-gh-release-action@v1
22+
env:
23+
# (required)
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Fetch source code
29+
uses: actions/checkout@v2
30+
# this should be with Cargo.lock files
31+
# technically, but this repo doesn't have them checked in to git
32+
- uses: actions/cache@v2
33+
with:
34+
path: |
35+
~/.cargo/bin/
36+
~/.cargo/registry/index/
37+
~/.cargo/registry/cache/
38+
~/.cargo/git/db/
39+
.cargo/bin/
40+
.cargo/registry/index/
41+
.cargo/registry/cache/
42+
.cargo/git/db/
43+
target/
44+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
45+
- name: Use Nix
46+
uses: cachix/install-nix-action@v16
47+
with:
48+
nix_path: nixpkgs=channel:nixos-21.05
49+
- name: Use Node.js ${{ matrix.node-version }}
50+
uses: actions/setup-node@v1
51+
with:
52+
node-version: ${{ matrix.node-version }}
53+
- name: Configure Nix substituters
54+
run: |
55+
set -xe
56+
mkdir -p ~/.config/nix/
57+
cp ./.github/nix.conf ~/.config/nix/
58+
- uses: cachix/cachix-action@v10
59+
with:
60+
name: ci-builds
61+
authToken: "${{ secrets.CACHIX_TOKEN }}"
62+
- name: Prepare Nix environment
63+
run: nix-shell --command "echo Completed"
64+
- name: Set up release bundle from template
65+
run: |
66+
cp -a bundles_templates/* bundles/
67+
RELEASE="${GITHUB_REF#refs/tags/}"
68+
sed -i "s/<release-download-url>/https:\/\/github.com\/${GITHUB_REPOSITORY%/*}\/${GITHUB_REPOSITORY#*/}\/releases\/download\/${RELEASE}/g" bundles/full_suite_release_template/happ.yaml
69+
cat bundles/full_suite_release_template/happ.yaml
70+
- name: Build WASM, dnas, happs
71+
run: nix-shell --run 'npm run build:crates'
72+
- name: upload bundles
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: |
76+
gh release upload "${GITHUB_REF#refs/tags/}" "bundles/full_suite_release_template/hrea_suite.happ" --clobber
77+
gh release upload "${GITHUB_REF#refs/tags/}" "happs/agent/hrea_agent.dna" --clobber
78+
gh release upload "${GITHUB_REF#refs/tags/}" "happs/agreement/hrea_agreement.dna" --clobber
79+
gh release upload "${GITHUB_REF#refs/tags/}" "happs/observation/hrea_observation.dna" --clobber
80+
gh release upload "${GITHUB_REF#refs/tags/}" "happs/planning/hrea_planning.dna" --clobber
81+
gh release upload "${GITHUB_REF#refs/tags/}" "happs/proposal/hrea_proposal.dna" --clobber
82+
gh release upload "${GITHUB_REF#refs/tags/}" "happs/specification/hrea_specification.dna" --clobber
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
manifest_version: "1"
2+
name: hrea_suite
3+
description: Complete configuration of all modules in the hREA suite.
4+
roles:
5+
- id: hrea_observation_1
6+
provisioning:
7+
strategy: create
8+
deferred: false
9+
dna:
10+
url: "<release-download-url>/hrea_observation.dna"
11+
clone_limit: 0
12+
- id: hrea_planning_1
13+
provisioning:
14+
strategy: create
15+
deferred: false
16+
dna:
17+
url: "<release-download-url>/hrea_planning.dna"
18+
clone_limit: 0
19+
- id: hrea_agreement_1
20+
provisioning:
21+
strategy: create
22+
deferred: false
23+
dna:
24+
url: "<release-download-url>/hrea_agreement.dna"
25+
clone_limit: 0
26+
- id: hrea_agent_1
27+
provisioning:
28+
strategy: create
29+
deferred: false
30+
dna:
31+
url: "<release-download-url>/hrea_agent.dna"
32+
clone_limit: 0

0 commit comments

Comments
 (0)