Skip to content

Commit

Permalink
19 bug automatic releases dont work properly (#25)
Browse files Browse the repository at this point in the history
* feat: implement separate job for test and build release only if test pass

* chore: remove old release builder as is not necessary
  • Loading branch information
cbatista8a authored Jul 4, 2024
1 parent c6c25f7 commit 63b63d9
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 80 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/release_builder.yml

This file was deleted.

59 changes: 42 additions & 17 deletions .github/workflows/semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,61 @@ on:
- main

permissions:
contents: write
contents: read

jobs:
tests:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer run-script test

# run this job only if the tests pass

release:
if: ${{ job.tests.outcome == 'success' }}
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to create releases
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests

steps:
- name: Checkout repository
uses: actions/checkout@v3

# - name: Setup Git user
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Format Code
run: composer run-script format

- name: Clean Dev Dependencies
run: |
rm -rf ./vendor
composer install --no-dev
- name: Release
id: semver
uses: huggingface/semver-release-action@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
if: steps.semver.outputs.released == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.semver.outputs.tag }}
release_name: "Flexi Framework ${{ steps.semver.outputs.version }}"
body: "Changelog: ${{ steps.semver.outputs.changelog }}"
draft: false
prerelease: false

0 comments on commit 63b63d9

Please sign in to comment.