Skip to content

Commit

Permalink
Merge pull request #102 from expipiplus1/actions
Browse files Browse the repository at this point in the history
Add actions to help with releases
  • Loading branch information
expipiplus1 authored Dec 8, 2020
2 parents 689db42 + 82d96c2 commit e356784
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/checkout@v2
- run: nix-build
- run: nix-build release.nix -A tarball
- run: nix-build release.nix -A sdistTest
- run: nix-build release.nix -A docs
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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:
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/checkout@v2

- 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
19 changes: 19 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tag Latest Release

on:
push:
branches:
- master

jobs:
update:
runs-on: ubuntu-20.04
steps:
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch everything
ssh-key: ${{ secrets.DEPLOY_KEY }}
- uses: expipiplus1/tag-latest-release/tag-latest-release@HEAD
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ license: BSD3
github: expipiplus1/vector-sized

extra-source-files:
- package.yaml
- readme.md
- changelog.md
- default.nix
Expand Down
10 changes: 10 additions & 0 deletions release.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs ? import <nixpkgs> { }, compiler ? null }:

with pkgs.haskell.lib;

let drv = import ./default.nix { inherit pkgs compiler; };
in {
tarball = sdistTarball drv;
docs = documentationTarball drv;
sdistTest = buildFromSdist drv;
}
1 change: 1 addition & 0 deletions vector-sized.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ license: BSD3
license-file: LICENSE
build-type: Simple
extra-source-files:
package.yaml
readme.md
changelog.md
default.nix
Expand Down

0 comments on commit e356784

Please sign in to comment.