ci: fix LICENSE #17
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-php: | |
name: Prepare PHP | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
php: [8.2] | |
steps: | |
- name: Build and prepare PHP cache | |
uses: pmmp/setup-php-action@main | |
with: | |
php-version: ${{ matrix.php }} | |
install-path: "../bin" | |
pharynx: | |
name: build phar | |
permissions: | |
contents: write | |
concurrency: | |
group: pharynx/${{github.ref}} | |
needs: [build-php] | |
runs-on: ubuntu-20.04 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
strategy: | |
matrix: | |
php: | |
- "8.2" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pmmp/setup-php-action@main | |
with: | |
php-version: ${{matrix.php}} | |
install-path: "../bin" | |
- uses: SOF3/[email protected] | |
id: pharynx | |
with: | |
additional-assets: | | |
assets/icon.png | |
- name: Setup staging branch | |
run: | | |
git fetch origin | |
if ! git checkout poggit/main; then | |
git checkout --orphan poggit/main | |
echo <<EOF >.poggit.yml | |
branches: poggit/main | |
projects: | |
${{github.repository}}: | |
type: plugin | |
compressBuilds: false | |
fullGzip: false | |
EOF | |
fi | |
mv .poggit.yml /tmp/.poggit.yml | |
git rm -fr . | |
git clean -dxff | |
mv /tmp/.poggit.yml .poggit.yml | |
- name: Restore LICENSE file | |
run: cp LICENSE /tmp/LICENSE | |
- name: Create commit | |
run: | | |
cp ${{steps.pharynx.outputs.output-phar}} DiscordChatBridge.phar | |
cp -r ${{steps.pharynx.outputs.output-dir}}/* . | |
cp /tmp/LICENSE LICENSE | |
git add -f LICENSE | |
git add -A | |
git \ | |
-c user.name="github-actions[bot]" \ | |
-c user.email="41898282+github-actions[bot]@users.noreply.github.com" \ | |
commit -am "${{github.event.head_commit.message}} (${{github.sha}})" | |
- name: Push commit | |
run: git push -u origin poggit/main |