-
Notifications
You must be signed in to change notification settings - Fork 24
80 lines (77 loc) · 2.78 KB
/
master-push.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
name: 'Master Push'
on:
push:
branches:
- master
jobs:
release:
name: 'Publish Release'
runs-on: ubuntu-latest
environment: production
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
ref: ${{ github.event.push.head.sha }}
fetch-depth: 0
- name: 'Make release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION=v$(cat package/version)
gh release create ${VERSION} --target ${{ github.sha }}
- name: 'Update dependents'
run: |
set -x
version="$(cat package/version)"
curl --fail \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.JENKINS_GITHUB_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/runtimeverification/devops/dispatches \
-d '{"event_type":"on-demand-test","client_payload":{"repo":"runtimeverification/wasm-semantics","version":"'${version}'"}}'
nix-cache:
name: 'Populate Nix Cache'
strategy:
matrix:
include:
- runner: normal
- runner: macos-13
- runner: ARM64
runs-on: ${{ matrix.runner }}
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
ref: ${{ github.event.push.head.sha }}
fetch-depth: 0
- name: 'Upgrade bash'
if: ${{ contains(matrix.os, 'macos') }}
run: brew install bash
- name: 'Install Nix'
if: ${{ matrix.runner == 'macos-13' }}
uses: cachix/install-nix-action@v19
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: 'Install Cachix'
if: ${{ matrix.runner == 'macos-13' }}
uses: cachix/cachix-action@v12
with:
name: k-framework
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
skipPush: true
- name: 'Build and cache KWASM'
uses: workflow/[email protected]
env:
GC_DONT_GC: 1
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'
with:
packages: jq
script: |
kwasm=$(nix build --extra-experimental-features 'nix-command flakes' .#kwasm --json | jq -r '.[].outputs | to_entries[].value')
drv=$(nix-store --query --deriver ${kwasm})
nix-store --query --requisites --include-outputs ${drv} | cachix push k-framework