Skip to content

Commit

Permalink
Merge pull request #23 from etherspot/feature/gh-release-and-package-…
Browse files Browse the repository at this point in the history
…versioning

Implement gh release and version check pipelines
  • Loading branch information
arddluma authored May 3, 2023
2 parents 2010ddc + b213570 commit 5f050ce
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/check-package-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check if package version is updated

on:
pull_request:
branches:
- master
jobs:
start:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check if version has been updated
id: check
uses: EndBug/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-name: ./package.json
- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Yayy!! Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: echo "No version change :/ Please update version in package.json!" && exit 1
16 changes: 15 additions & 1 deletion .github/workflows/docker.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,28 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Get package version
id: get_version
run: echo version=$(node -p "require('./package.json').version") >> $GITHUB_OUTPUT
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/skandha:latest
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/skandha:${{ steps.get_version.outputs.version }}
${{ secrets.DOCKERHUB_USERNAME }}/skandha:latest
-
name: Create GitHub release
uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.get_version.outputs.version }}
prerelease: false
title: Release ${{ steps.get_version.outputs.version }}
-
name: Trigger pipeline
run: ${{ secrets.PIPELINE_TRIGGER }}

0 comments on commit 5f050ce

Please sign in to comment.