-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (131 loc) · 4.89 KB
/
release.yml
File metadata and controls
132 lines (131 loc) · 4.89 KB
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
name: release
on: [push]
jobs:
release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v2
- name: Ensure cache dir exists
run: |
whoami
mkdir -p /tmp/nix_ci_cache
sudo chown -R $USER:$USER /tmp/nix_ci_cache
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
system-features = kvm
http2 = false
require-sigs = false
sandbox = false
cores = 2
max-jobs = 4
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org file:///tmp/nix_ci_cache https://cache.iog.io
trusted-substituters = file:///tmp/nix_ci_cache
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
post-build-hook = ${{ github.workspace }}/nix/upload-to-cache.sh
- uses: actions/cache@v3
with:
path: /tmp/nix_ci_cache
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
- name: Test all
run: |
which nix
mkdir -p ${{ github.workspace }}/logs
chmod -R 777 ${{ github.workspace }}/logs
logsdir="${{ github.workspace }}/logs"
nix-build --option sandbox false --show-trace --pure ./test.nix --argstr log "$logsdir"
./result/bin/all-tests
- uses: actions/upload-artifact@v3
if: failure()
with:
name: test-logs
path: ${{ github.workspace }}/logs/
- name: Release all
run: ./nix/ci-release.sh
- name: Create github release
if: github.ref_type == 'tag'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: false
- name: Docker login
if: github.ref_type == 'tag'
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker push
if: github.ref_type == 'tag'
run: ./nix/ci-push.sh
- name: Upload btc-lsp docker image
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./btc-lsp/build/docker-image-btc-lsp.tar.gz
asset_name: docker-image-btc-lsp.tar.gz
asset_content_type: application/gzip
- name: Upload btc-lsp docker image version
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./btc-lsp/build/docker-image-btc-lsp.txt
asset_name: docker-image-btc-lsp.txt
asset_content_type: text/plain
- name: Upload integration docker image
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./btc-lsp/build/docker-image-integration.tar.gz
asset_name: docker-image-integration.tar.gz
asset_content_type: application/gzip
- name: Upload integration docker image version
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./btc-lsp/build/docker-image-integration.txt
asset_name: docker-image-integration.txt
asset_content_type: text/plain
- name: Upload electrs docker image
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./electrs-client/build/docker-image-electrs.tar.gz
asset_name: docker-image-electrs.tar.gz
asset_content_type: application/gzip
- name: Upload electrs docker image version
if: github.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./electrs-client/build/docker-image-electrs.txt
asset_name: docker-image-electrs.txt
asset_content_type: text/plain