Skip to content
Snippets Groups Projects
Commit aad99602 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

ci(release): configure semantic-release to automate castopod bundle versionned release

- semantic-release plugins will update castopod version, CHANGELOG.md file, and push a tagged
release on https://code.podlibre.org
- prepareRelease.sh script updates composer.json version and
generates the castopod bundle for the released version

closes #47
parent 50e32ff7
No related branches found
No related tags found
No related merge requests found
Pipeline #239 failed
......@@ -2,6 +2,7 @@ image: php:7.2-fpm
stages:
- bundle
- release
cache:
paths:
......@@ -34,11 +35,12 @@ before_script:
- php composer.phar install --no-dev --ignore-platform-reqs
- npm install
# build all UI assets
- npm run build
bundle_app:
stage: bundle
script:
# build all assets for views
- npm run build
# download GeoLite2-City archive and extract it to writable/uploads
- wget -c "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=$MAXMIND_LICENCE_KEY&suffix=tar.gz" -O - | tar -xz -C ./writable/uploads/
......@@ -51,3 +53,17 @@ bundle_app:
name: "castopod-${CI_COMMIT_REF_SLUG}_${CI_COMMIT_SHORT_SHA}"
paths:
- bundle
except:
- master
- beta
- alpha
release_app:
stage: release
script:
- apt-get install jq -y
- npm run release
only:
- main
- alpha
- beta
{
"branches": [
"main",
{ "name": "alpha", "prerelease": true },
{ "name": "beta", "prerelease": true }
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
[
"@semantic-release/gitlab",
{
"gitlabUrl": "https://code.podlibre.org/",
"assets": [
{
"path": "castopod-${nextRelease.version}",
"label": "Castopod v${nextRelease.version}"
}
]
}
]
],
"prepare": [
"@semantic-release/changelog",
"@semantic-release/npm",
{
"path": "@semantic-release/git",
"assets": [
"composer.json",
"package.json",
"package-lock.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
}
{
"name": "podlibre/castopod",
"version": "0.0.0-dev",
"type": "project",
"description": "Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"homepage": "https://castopod.org",
......
This diff is collapsed.
......@@ -21,7 +21,8 @@
"lint:css": "stylelint \"app/Views/_assets/**/*.css\"",
"prettier:fix": "prettier --write --ignore-path .gitignore .",
"typecheck": "tsc",
"commit": "git-cz"
"commit": "git-cz",
"release": "semantic-release"
},
"dependencies": {
"@amcharts/amcharts4": "^4.10.7",
......@@ -46,6 +47,10 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/gitlab": "^6.0.5",
"@tailwindcss/custom-forms": "^0.2.1",
"@tailwindcss/typography": "^0.2.0",
"@types/prosemirror-markdown": "^1.0.3",
......@@ -70,6 +75,7 @@
"rollup-plugin-node-polyfills": "^0.2.1",
"rollup-plugin-postcss": "^3.1.8",
"rollup-plugin-terser": "^7.0.2",
"semantic-release": "^17.2.1",
"stylelint": "^13.7.2",
"stylelint-config-standard": "^20.0.0",
"svgo": "^1.3.2",
......
#!/bin/bash
VERSION=$1
COMPOSER_VERSION=$(echo "$VERSION" | perl -pe 's/(?<=[alpha|beta])\.//g')
# replace composer.json version using jq
echo "$( jq '.version = "'$COMPOSER_VERSION'"' composer.json )" > composer.json
# download GeoLite2-City archive and extract it to writable/uploads
wget -c "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=v3PguJMcmZMb9Ld0&suffix=tar.gz" -O - | tar -xz -C ./writable/uploads/
# rename extracted archives' folders
mv ./writable/uploads/GeoLite2-City* ./writable/uploads/GeoLite2-City
# create bundle folder: uses .rsync-filter (-F) file to copy only needed files
rsync -avF --progress . ./castopod-$VERSION
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment