-
Notifications
You must be signed in to change notification settings - Fork 14
45 lines (40 loc) · 1.6 KB
/
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
name: Create Release
on:
push:
tags:
- v*
jobs:
build:
name: Create Release
runs-on: ubuntu-20.04
steps:
- uses: cachix/install-nix-action@v12
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= orion:s0C06f1M46DCpHUUP2r8iIrhfytkCbXWltMeMMa4jbw= expipiplus1/update-nix-fetchgit:Z33K0KEImsos+kVTFvZxfLxaBi+D1jEeB6cX0uCo7B0=
substituters = https://cache.nixos.org/ s3://nix-cache?region=ap-southeast-1&scheme=https&endpoint=binarycache.home.monoid.al
- uses: actions/checkout@v2
- run: |
sudo -H aws configure set aws_access_key_id nix
sudo -H aws configure set aws_secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
- name: Build project
run: |
mkdir assets
nix-build ./release.nix -A sdistTest --no-out-link
ln -s "$(nix-build release.nix -A tarball --no-out-link)"/*.tar.gz assets/
ln -s "$(nix-build release.nix -A docs --no-out-link)"/*.tar.gz assets/
ref="${{ github.ref }}"
printf "Release ${ref#"refs/tags/"}\n\n" >release-note.md
# Get the section after the WIP section
awk '/## WIP/{flag=0;next};/##/{flag=flag+1};flag==1' <changelog.md |
sed "/^##/d" >>"release-note.md"
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -f release-note.md ]; then
hub release create \
$(find assets -type f -o -type l -printf "--attach %p ") \
--file release-note.md \
${{ github.ref }}
fi