Skip to content

Create Release

Create Release #56

name: Create Release
env:
MILESTONE: ${{ github.event.milestone.title }}
on:
milestone:
types:
- closed
jobs:
generate-changelog:
name: Generate Changelog
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
steps:
- name: Generate changelog
uses: WyriHaximus/github-action-jwage-changelog-generator@v1
id: changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
milestone: ${{ env.MILESTONE }}
- name: Show changelog
run: echo "${CHANGELOG}"
env:
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
create-release:
name: Create Release
needs:
- generate-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
env:
CHANGELOG: ${{ needs.generate-changelog.outputs.changelog }}
- run: |
echo -e "${MILESTONE_DESCRIPTION}\r\n\r\n${CHANGELOG}" > release-${{ env.MILESTONE }}-release-message.md
cat release-${{ env.MILESTONE }}-release-message.md
release_message=$(cat release-${{ env.MILESTONE }}-release-message.md)
release_message="${release_message//'%'/'%25'}"
release_message="${release_message//$'\n'/'%0A'}"
release_message="${release_message//$'\r'/'%0D'}"
echo "::set-output name=release_message::$release_message"
id: releasemessage
env:
MILESTONE_DESCRIPTION: ${{ github.event.milestone.description }}
CHANGELOG: ${{ needs.generate-changelog.outputs.changelog }}
- name: Create Reference Release with Changelog
uses: fleskesvor/create-release@feature/support-target-commitish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.MILESTONE }}
release_name: ${{ env.MILESTONE }}
body: ${{ steps.releasemessage.outputs.release_message }}
draft: false
prerelease: false
push-to-s3:
name: Push to S3
needs:
- create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: Composer Install
run: composer install --ansi --no-progress --no-interaction --prefer-dist -o
- name: Generate Blog
run: vendor/bin/sculpin generate --env=prod
- uses: shallwefootball/s3-upload-action@v1.3.3
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: 'output_prod'
destination_dir: ''