-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (67 loc) · 2.27 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
name: 'Master Push'
on:
push:
branches:
- master
jobs:
nix-flake-release:
name: 'Nix flake release'
strategy:
matrix:
include:
- runner: ubuntu-latest
os: ubuntu-latest
- runner: macos-12
os: macos-12
- runner: MacM1
os: self-macos-12
runs-on: ${{ matrix.runner }}
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- name: 'Upgrade bash'
if: ${{ contains(matrix.os, 'macos') }}
run: brew install bash
- name: 'Install Nix/Cachix'
if: ${{ !startsWith(matrix.os, 'self') }}
uses: cachix/install-nix-action@v22
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- if: ${{ !startsWith(matrix.os, 'self') }}
uses: cachix/cachix-action@v12
with:
name: k-framework
authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }}
skipPush: true
- name: 'Build and cache kavm'
env:
GC_DONT_GC: 1
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'
NIX_PATH: 'nixpkgs=http://nixos.org/channels/nixos-22.05/nixexprs.tar.xz'
run: |
export JQ=$(nix-build '<nixpkgs>' -A jq --no-link)/bin/jq
kavm=$(nix build .#kavm --json | $JQ -r '.[].outputs | to_entries[].value')
drv=$(nix-store --query --deriver ${kavm})
nix-store --query --requisites --include-outputs ${drv} | cachix push k-framework
tag-release:
name: 'Tag Release'
runs-on: ubuntu-latest
needs: nix-flake-release
steps:
- name: 'Check out code'
uses: actions/checkout@v3
with:
token: ${{ secrets.JENKINS_GITHUB_PAT }}
# fetch-depth 0 means deep clone the repo
fetch-depth: 0
- name: 'Update Version'
run: |
git config user.name devops
git config user.email [email protected]
version=v"$(cat package/version)"
git tag --delete "${version}" || true
git push --delete origin "${version}" || true
git tag "${version}" HEAD
git push origin "${version}:${version}"