Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix changelog generation #411

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 8 additions & 30 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ on:
schedule:
- cron: '0 0 * * *'
jobs:
release:
if: github.ref_type == 'tag'
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Create release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prepare:
runs-on: ubuntu-latest
outputs:
Expand All @@ -36,6 +24,8 @@ jobs:
id: ref
if: github.event_name == 'schedule'
run: echo ref="$(gh release view --repo dunglas/frankenphp --json tagName --jq '.tagName')" >> "${GITHUB_OUTPUT}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux:
name: Build Linux x86_64 binary
runs-on: ubuntu-latest
Expand Down Expand Up @@ -84,15 +74,9 @@ jobs:
-
name: Upload asset
if: github.event_name == 'schedule' || github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
tag: ${{ (github.ref_type == 'tag' && github.ref_name) || needs.prepare.outputs.ref }}
generateReleaseNotes: true
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: frankenphp-linux-x86_64
replacesArtifacts: true
run: gh release upload "${{ (github.ref_type == 'tag' && github.ref_name) || needs.prepare.outputs.ref }}" frankenphp-linux-x86_64 --repo dunglas/frankenphp --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload artifact
if: github.ref_type == 'branch'
Expand Down Expand Up @@ -138,15 +122,9 @@ jobs:
-
name: Upload asset
if: github.event_name == 'schedule' || github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
tag: ${{ (github.ref_type == 'tag' && github.ref_name) || needs.prepare.outputs.ref }}
generateReleaseNotes: true
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: dist/frankenphp-mac-x86_64
replacesArtifacts: true
run: gh release upload "${{ (github.ref_type == 'tag' && github.ref_name) || needs.prepare.outputs.ref }}" dist/frankenphp-mac-x86_64 --repo dunglas/frankenphp --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Upload artifact
if: github.ref_type == 'branch'
Expand Down
2 changes: 1 addition & 1 deletion frankenphp.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package frankenphp

//go:generate rm -Rf C-Thread-Pool/
//go:generate git clone --depth=1 git@github.com:Pithikos/C-Thread-Pool.git
//go:generate rm -Rf C-Thread-Pool/.git C-Thread-Pool/.circleci C-Thread-Pool/docs C-Thread-Pool/tests C-Thread-Pool/example.c
//go:generate rm -Rf C-Thread-Pool/.git C-Thread-Pool/.github C-Thread-Pool/docs C-Thread-Pool/tests C-Thread-Pool/example.c

// Use PHP includes corresponding to your PHP installation by running:
//
Expand Down
14 changes: 12 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ if ! type "git" > /dev/null; then
exit 1
fi

if [ $# -ne 1 ]; then
if ! type "gh" > /dev/null; then
echo "The \"gh\" command must be installed."
exit 1
fi

if [[ $# -ne 1 ]]; then
echo "Usage: ./release.sh version" >&2
exit 1
fi
Expand All @@ -38,7 +43,12 @@ git tag -s -m "Version $1" "v$1"
git tag -s -m "Version $1" "caddy/v$1"
git push --follow-tags

if [ "$(uname -s)" = "Darwin" ]; then
tags=$(git tag --list --sort=-version:refname 'v*')
previous_tag=$(awk 'NR==2 {print;exit}' <<< "${tags}")

gh release create --draft --generate-notes --latest --notes-start-tag "${previous_tag}" --verify-tag "v$1"

if [[ "$(uname -s)" = "Darwin" ]]; then
rm -Rf dist/*
FRANKENPHP_VERSION=$1 RELEASE=1 ./build-static.sh
fi
Loading