Skip to content

Commit

Permalink
chore(GHA): add push to master workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rockandska committed Nov 20, 2021
1 parent ad8c736 commit 299d5c8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/push_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release
on:
push:
branches:
- master
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- shellcheck
- test-bats-bash-4.4.23
steps:
- uses: actions/checkout@v2
- name: make ${{matrix.target}}
shell: 'script -qfec "bash {0}"'
run: make ${{matrix.target}}
Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure git
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Make release
run: make release
- uses: docker/login-action@v1
with:
username: rockandska
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish release
run: |
make docker-publish
- name: Push back CHANGELOG and tag
run: git push --follow-tags
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ release:
|| printf '%s\n' "Version: $${NEXT_VERSION}"
CHANGELOG_TAG="$${NEXT_VERSION}" $(MAKE) --no-print-directory changelog

$(MKFILE_DIR)/.github/workflows/pull_request.yml: .FORCE
$(MKFILE_DIR)/.github/workflows/pull_request.yml: .FORCE $(MKFILE_DIR)/.github/workflows/push_master.yml
printf '%s\n' '### Updating GHA pull_request workflow ###'
docker run --rm -v "$(MKFILE_DIR):$(MKFILE_DIR)" mikefarah/yq:4.9.6 -i eval '.jobs.Tests.strategy.matrix.target = [ "$(subst $(_SPACE),"$(_SPACE)$(_COMMA)$(_SPACE)",$(strip $(TEST_TARGETS)))" ]' $@

$(MKFILE_DIR)/.github/workflows/push_master.yml: .FORCE
printf '%s\n' '### Updating GHA push_request workflow ###'
docker run --rm -v "$(MKFILE_DIR):$(MKFILE_DIR)" mikefarah/yq:4.9.6 -i eval '.jobs.Tests.strategy.matrix.target = [ "$(subst $(_SPACE),"$(_SPACE)$(_COMMA)$(_SPACE)",$(strip $(TEST_TARGETS)))" ]' $@

0 comments on commit 299d5c8

Please sign in to comment.