chore: Enhance release workflow (#1400)
* Rename package-release to release * Move tarball creation in Makefile * Enhance release workflow * Add --ignore-platform-reqs to composer build
This commit is contained in:
parent
8411c6225f
commit
4335795c52
|
@ -1,58 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
#release.sh 1.8.2
|
|
||||||
#creates a libretime folder with a "1.8.2" suffix
|
|
||||||
#creates tarballs with a "1.8.2" suffix
|
|
||||||
|
|
||||||
#release.sh 1.8.2 RC
|
|
||||||
#creates a libretime folder with a "1.8.2-RC" suffix
|
|
||||||
#creates tarballs with a "1.8.2-RC" suffix
|
|
||||||
|
|
||||||
#release.sh 1.8.2-RC
|
|
||||||
#creates a libretime folder with a "1.8.2-RC" suffix
|
|
||||||
#creates tarballs with a "1.8.2-RC" suffix
|
|
||||||
|
|
||||||
if [ $# == 0 ]; then
|
|
||||||
echo "Zero arguments"
|
|
||||||
exit 1
|
|
||||||
elif [ $# == 1 ]; then
|
|
||||||
suffix=$1
|
|
||||||
else
|
|
||||||
suffix=$1-$2
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Creating tarball for LibreTime ${suffix}."
|
|
||||||
|
|
||||||
echo -n "Creating VERSION file for ${suffix}..."
|
|
||||||
echo -n "${suffix}" > ./VERSION
|
|
||||||
echo " Done"
|
|
||||||
|
|
||||||
echo -n "Running composer install..."
|
|
||||||
pushd legacy || (echo "could not cd in legacy!" && exit 1)
|
|
||||||
composer install --quiet --no-dev --ignore-platform-reqs
|
|
||||||
popd || exit
|
|
||||||
echo " Done"
|
|
||||||
|
|
||||||
# Adding back; may be useful later...
|
|
||||||
#echo "Minimizing LibreTime Javascript files..."
|
|
||||||
#cd $dir
|
|
||||||
#find $target/legacy/public/js/airtime/ -iname "*.js" -exec bash -c 'echo {}; jsmin/jsmin < {} > {}.min' \;
|
|
||||||
#find $target/legacy/public/js/airtime/ -iname "*.js" -exec mv {}.min {} \;
|
|
||||||
#echo "Done"
|
|
||||||
|
|
||||||
cd ..
|
|
||||||
find "libretime-${suffix}" -type f -exec dos2unix {} \;
|
|
||||||
echo -n "Creating tarball..."
|
|
||||||
tar -czf "libretime-${suffix}.tar.gz" \
|
|
||||||
--owner=root --group=root \
|
|
||||||
--exclude-vcs \
|
|
||||||
--exclude .zfproject.xml \
|
|
||||||
--exclude .gitignore \
|
|
||||||
--exclude .gitattributes \
|
|
||||||
--exclude .travis.yml \
|
|
||||||
--exclude travis \
|
|
||||||
--exclude dev_tools \
|
|
||||||
--exclude legacy/vendor/phing \
|
|
||||||
--exclude legacy/vendor/simplepie/simplepie/tests \
|
|
||||||
libretime
|
|
||||||
echo " Done"
|
|
|
@ -1,25 +1,26 @@
|
||||||
name: Create Release .tar.gz
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# Sequence of patterns matched against refs/tags
|
|
||||||
tags:
|
tags:
|
||||||
# MAJ.MIN.BUG version with an optional -TYPE.VER (for example 3.0.0-alpha.8)
|
|
||||||
- '\d+.\d+.\d+(-\w+\.\d+)*'
|
- '\d+.\d+.\d+(-\w+\.\d+)*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release:
|
||||||
name: Upload Release Asset
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: 7.4
|
||||||
|
|
||||||
- name: Read file contents
|
- name: Read file contents
|
||||||
id: release_notes_file
|
id: release_notes_file
|
||||||
uses: andstor/file-reader-action@v1
|
uses: andstor/file-reader-action@v1
|
||||||
with:
|
with:
|
||||||
path: ./.github/RELEASE.md
|
path: ./.github/RELEASE.md
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
|
@ -31,18 +32,17 @@ jobs:
|
||||||
body: ${ steps.release_notes_file.outputs.contents }
|
body: ${ steps.release_notes_file.outputs.contents }
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
- name: Build project
|
|
||||||
run: |-
|
- name: Build tarball
|
||||||
sudo apt update -y -q
|
run: make tarball
|
||||||
sudo apt install dos2unix php composer -y
|
|
||||||
./.github/scripts/release.sh ${{ github.ref }}
|
|
||||||
- name: Upload Release Asset
|
- name: Upload Release Asset
|
||||||
id: upload-release-asset
|
id: upload-release-asset
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: ../libretime-${{ github.ref }}.tar.gz
|
asset_path: libretime-${{ github.ref }}.tar.gz
|
||||||
asset_name: libretime-${{ github.ref }}.tar.gz
|
asset_name: libretime-${{ github.ref }}.tar.gz
|
||||||
asset_content_type: application/tgz
|
asset_content_type: application/tgz
|
16
Makefile
16
Makefile
|
@ -17,3 +17,19 @@ shell-check:
|
||||||
|
|
||||||
VERSION:
|
VERSION:
|
||||||
tools/version.sh
|
tools/version.sh
|
||||||
|
|
||||||
|
.PHONY: tarball
|
||||||
|
tarball: VERSION
|
||||||
|
$(MAKE) -C legacy build
|
||||||
|
cd .. && tar -czf libretime-$(shell cat VERSION | tr -d [:blank:]).tar.gz \
|
||||||
|
--owner=root --group=root \
|
||||||
|
--exclude-vcs \
|
||||||
|
--exclude .codespellignore \
|
||||||
|
--exclude .git* \
|
||||||
|
--exclude .pre-commit-config.yaml \
|
||||||
|
--exclude dev_tools \
|
||||||
|
--exclude jekyll.sh \
|
||||||
|
--exclude legacy/vendor/phing \
|
||||||
|
--exclude legacy/vendor/simplepie/simplepie/tests \
|
||||||
|
libretime
|
||||||
|
mv ../libretime-*.tar.gz .
|
||||||
|
|
|
@ -30,4 +30,4 @@ lint: $(PHP-CS-FIXER)
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
COMPOSER_ARGS=--no-dev $(MAKE)
|
COMPOSER_ARGS="--no-dev --ignore-platform-reqs" $(MAKE)
|
||||||
|
|
Loading…
Reference in New Issue