Fix release.yml not adding example env #81
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Update Embedded Version String | |
env: | |
REF: ${{ github.ref }} | |
run: | | |
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php | |
- name: Build Assets | |
run: | | |
npm install | |
npm run build | |
- name: Create Release Archive | |
run: | | |
# Array of files and directories to remove | |
files_to_remove=( | |
"node_modules/" | |
"tests/" | |
"CODE_OF_CONDUCT.md" | |
"CONTRIBUTOR_LICENSE_AGREEMENT" | |
"crowdin.yml" | |
"docker-compose.ci.yml" | |
"phpstan.neon" | |
"phpunit.xml" | |
"stats.html" | |
) | |
# Loop over the files to remove and delete them | |
rm -rf "${files_to_remove[@]}" | |
# Array of specific dot files to include | |
files_to_include=( | |
".editorconfig" | |
".env.example" | |
".gitattributes" | |
".gitignore" | |
".prettierignore" | |
".prettierrc.json" | |
) | |
# Archive files, using * directly outside the array for proper expansion | |
tar -czf panel.tar.gz * "${files_to_include[@]}" | |
- name: Extract Changelog | |
id: extract_changelog | |
env: | |
REF: ${{ github.ref }} | |
run: | | |
sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG | |
echo "version_name=${REF:10}" >> $GITHUB_OUTPUT | |
- name: Create Checksum and Add to Changelog | |
run: | | |
SUM=`sha256sum panel.tar.gz` | |
echo -e "\n#### SHA256 Checksum\n\n\`\`\`\n$SUM\n\`\`\`\n" >> ./RELEASE_CHANGELOG | |
echo $SUM > checksum.txt | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ steps.extract_changelog.outputs.version_name }} | |
body_path: ./RELEASE_CHANGELOG | |
draft: true | |
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') || contains(github.ref, 'rc') }} | |
files: | | |
panel.tar.gz | |
checksum.txt |