actions #1
Workflow file for this run
This file contains hidden or 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: ["*"] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out code 🛒 | |
| uses: actions/checkout@v6 | |
| - name: Setup PHP 🐫 | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| - name: Linter 🧹 | |
| run: make lint | |
| package: | |
| runs-on: ubuntu-24.04 | |
| needs: [lint] | |
| permissions: | |
| contents: write | |
| env: | |
| BUILD_DIR: "build" | |
| DIST_DIR_GITHUB: "dist/github" | |
| GITHUB_RELEASE_FILENAME: "lantern.zip" | |
| THEME_SLUG: "lantern" | |
| steps: | |
| - name: Check out code 🛒 | |
| uses: actions/checkout@v6 | |
| - name: Build theme zip 🔧 | |
| id: build-package | |
| run: | | |
| export ZIP_FILENAME=${THEME_SLUG}-${GITHUB_REF_NAME}.zip | |
| find ./lantern -type d -print0 | xargs -0 chmod 755 | |
| find ./lantern -name '*.php' -print0 | xargs -0 chmod 644 | |
| echo "${GITHUB_SHA}" > lantern/build.txt | |
| make build | |
| mkdir -p "${DIST_DIR_GITHUB}" | |
| cp "${BUILD_DIR}/${THEME_SLUG}.zip" "${DIST_DIR_GITHUB}/${GITHUB_RELEASE_FILENAME}" | |
| cp "${BUILD_DIR}/${THEME_SLUG}.zip" "${DIST_DIR_GITHUB}/${ZIP_FILENAME}" | |
| echo "ARTIFACT_PATH=${DIST_DIR_GITHUB}/${GITHUB_RELEASE_FILENAME}" >> $GITHUB_ENV | |
| echo "ARTIFACT_TAGGED=${DIST_DIR_GITHUB}/${ZIP_FILENAME}" >> $GITHUB_ENV | |
| - name: Generate release notes 📝 | |
| if: github.ref_type == 'tag' | |
| run: | | |
| chmod +x ./.github/scripts/release-notes.sh | |
| ./.github/scripts/release-notes.sh "${GITHUB_REF_NAME}" CHANGELOG.md > release-notes.md | |
| echo "----- release notes preview -----" | |
| cat release-notes.md | |
| RELEASE_TYPE=$(if [[ "${GITHUB_REF_NAME}" =~ beta|rc|alpha ]]; then echo "true"; else echo "false"; fi) | |
| echo "RELEASE_TYPE=${RELEASE_TYPE}" >> $GITHUB_ENV | |
| - name: Create GitHub release 🎉 | |
| if: github.ref_type == 'tag' | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "${{ env.ARTIFACT_PATH }},${{ env.ARTIFACT_TAGGED }}" | |
| bodyFile: "release-notes.md" | |
| prerelease: ${{ env.RELEASE_TYPE }} | |
| generateReleaseNotes: false | |
| allowUpdates: true |