Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Simplify publish CI workflow #28

Merged
merged 1 commit into from Oct 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/publish.yml
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- master
paths:
- "**.nim"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


jobs:
build:
Expand All @@ -23,26 +25,16 @@ jobs:
- name: Install Nim build tools
run: ./.github/bin/install-build-tools

- name: Check if there was a code change
run: |
git fetch origin ${{ github.event.before }} --depth=1
if git diff --name-only ${{ github.event.before }} "${GITHUB_SHA}" | grep '^src/.*.nim$'; then
echo 'NIMFILECHANGED=true' >> "${GITHUB_ENV}"
fi

- name: Bump version and push tag
if: env.NIMFILECHANGED == 'true'
run: ./.github/bin/release

- name: Build binary
run: ./.github/bin/build

- name: Export current version
if: env.NIMFILECHANGED == 'true'
run: ./.github/bin/export-version

- name: Publish release
if: env.NIMFILECHANGED == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down