Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
constanca-m committed Apr 15, 2024
1 parent afd3772 commit e518c55
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
## Workflow to create a new git tag if version.py variable version gets updated
name: release

permissions:
contents: write # write permission is required to create a GitHub release

on:
push:
branches:
- 'main'
paths:
- 'share/version.py'

jobs:

release:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:

- uses: actions/checkout@v4

- name: Get version number
shell: bash
run: |
VERSION=$(awk '/version/ {print $3}' version.py | tr -d '"')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/lambda-v' + ${{ env.VERSION }},
sha: context.sha
})

0 comments on commit e518c55

Please sign in to comment.