Skip to content

Commit

Permalink
Merge branch 'main' of github.com:steadfast-collective/convertkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan McClean committed Jul 21, 2023
2 parents f514437 + 77529cc commit 69303f8
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 54 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow tags a release, builds front-end assets and sends various notifications & webhooks when a release has been created.

# How it works:
# 1. Add release notes to the CHANGELOG.md file. Commit & push them up.
# 2. Create a git tag and push it up - `git tag <version number> && git push origin --tags`
# 3. This action will create a release, using the latest notes from the CHANGELOG.md file.
# 4. It'll build the front-end assets and attach them to the release.
# 5. Finally, it'll comment on the PRs & Issues mentioned in the changelog to let everyone know a release has been tagged.

name: Release

on:
push:
tags:
- "v*"

jobs:
release:
name: Prepare & Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
tools: composer:v2

- name: Install NPM Dependencies
run: npm install

- name: Install Composer Dependencies
run: composer install

- name: Compile assets
run: npm run build

- name: Create zip
run: tar -czvf dist.tar.gz dist

- name: Get Changelog
id: changelog
uses: statamic/changelog-action@v1
with:
version: ${{ github.ref }}

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.changelog.outputs.text }}
prerelease: ${{ contains(github.ref, '-beta') }}

- name: Upload zip to release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.tar.gz
asset_name: dist.tar.gz
asset_content_type: application/tar+gz

- name: Comment on related issues
uses: duncanmcclean/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: ${{ github.ref }}
changelog: ${{ steps.changelog.outputs.text }}
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.DS_Store
.phpunit.result.cache
.php_cs.cache
.php-cs-fixer.cache
.idea
node_modules
vendor
mix-manifest.json
resources/dist/hot
dist
!dist/.gitkeep
vite.hot
.env
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
"providers": [
"SteadfastCollective\\ConvertKit\\ServiceProvider"
]
},
"download-dist": {
"url": "https://github.com/steadfast-collective/convertkit/releases/download/{$version}/dist.tar.gz",
"path": "dist"
}
},
"require": {
"pixelfear/composer-dist-plugin": "^0.1.6"
},
"config": {
"allow-plugins": {
"pixelfear/composer-dist-plugin": true
}
}
}
53 changes: 51 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions resources/css/addon.css

This file was deleted.

1 change: 0 additions & 1 deletion resources/dist/build/assets/addon-d503415a.css

This file was deleted.

Loading

0 comments on commit 69303f8

Please sign in to comment.