Skip to content

Commit

Permalink
Merge pull request #5 from Element84/update-lambda-build-and-release
Browse files Browse the repository at this point in the history
Updates to github action to create a draft release
  • Loading branch information
bick4ord authored Jul 25, 2023
2 parents 97d8196 + 5df9ac3 commit 846f265
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
release:
needs: [tests]
name: Create GitHub Release
if: github.event_name == 'release'
if: startsWith(github.event.ref, 'refs/tags/v')
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
Expand All @@ -119,15 +119,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set tag name
- name: Get release tag name
id: tag
run: |
if [[ "${{ github.event_name }}" != "push" ]]; then
tag=v$(date +%Y%m%d.%H%M%S)
else
tag=$(basename "${{ github.ref }}")
fi
echo "tag=$tag" >> $GITHUB_OUTPUT
run: echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT

- name: Create Draft Release
id: create_release
Expand All @@ -137,11 +131,13 @@ jobs:
with:
tag_name: ${{ steps.tag.outputs.tag }}
release_name: ${{ steps.tag.outputs.tag }}
body_path: CHANGES.md
draft: true
prerelease: false

build-lambda:
needs: [release]
name: Build Release Lambda
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -171,17 +167,6 @@ jobs:
asset_name: lambda-python3.9.zip
asset_content_type: application/zip

metadata:
name: Publish Release
needs: [release, build-lambda]
runs-on: ubuntu-latest
steps:
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.release.outputs.release_id }}

publish-docker:
needs: [tests]
if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
Expand Down

0 comments on commit 846f265

Please sign in to comment.