Skip to content

Commit

Permalink
ci(github/actions): add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
justinrubek committed Oct 6, 2023
1 parent f4fc942 commit 0917eb4
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: publish to github releases
on:
push:
tags:
- "*"

jobs:
publish-github:
name: publish to github releases
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install nix
uses: cachix/install-nix-action@v15
with:
extra_nix_config: |
access-tokens = github=${{ secrets.GITHUB_TOKEN }}
extra-substituers = https://cache.garnix.io
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
- name: get version
id: get-version
run: |
VERSION=`git describe --tags $(git rev-list --tags --max-count=1)`
echo ::set-output name=version::"$VERSION"
- name: generate changelog
env:
VERSION: ${{ steps.get-version.outputs.version }}
run: |
nix develop .#ci -c cog changelog --at $VERSION -t full_hash > GITHUB_CHANGELOG.md
- name: generate release
uses: softprops/action-gh-release@v1
with:
body_path: GITHUB_CHANGELOG.md
tag_name: ${{ steps.get-version.outputs.version }}

0 comments on commit 0917eb4

Please sign in to comment.