Skip to content

Update image-build.yml #72

Update image-build.yml

Update image-build.yml #72

---
name: "Release"
on:
pull_request:
types:
- closed
branches:
- main
jobs:
release:
outputs:
tag: ${{ steps.tag.outputs.new_tag }}
release_type: ${{ steps.release_type.outputs.PRERELEASE }}
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: "0"
- name: release or prerelease
id: release_type
run: |
if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
echo "This is a release"
echo "PRERELEASE=false" >> $GITHUB_OUTPUT
else
echo "This is a prerelease"
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
fi
- name: Bump version and push tag
id: tag
uses: anothrNick/[email protected] # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
PRERELEASE_SUFFIX: dev
PRERELEASE: "${{ steps.release_type.outputs.PRERELEASE }}"
- name: Create prerelease
if: steps.release_type.outputs.PRERELEASE == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.tag.outputs.new_tag }} --title "Dev ${{ steps.tag.outputs.new_tag }}" --prerelease --generate-notes --verify-tag
- name: Create release
if: steps.release_type.outputs.PRERELEASE == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ steps.tag.outputs.new_tag }} --title "Release ${{ steps.tag.outputs.new_tag }}" --generate-notes --verify-tag
trigger_build:
needs: release
uses: ./.github/workflows/image-build.yml
with:
tag: ${{ needs.release.outputs.tag }}
secrets: inherit