Built-in GIF block type conversion (#242) #26
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: Nightly Build | |
on: | |
push: | |
branches: | |
- main | |
# Cancels all previous workflow runs for the same branch that have not yet completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
jobs: | |
nightly: | |
name: Nightly Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get current tag for HEAD | |
run: | | |
echo "CURRENT_TAG=$(git tag --points-at HEAD)" >> $GITHUB_ENV | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
with: | |
php-version: latest | |
coverage: none | |
tools: wp-cli | |
- name: Install latest version of dist-archive-command | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
run: wp package install wp-cli/dist-archive-command:dev-main | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: Install dependencies | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
run: npm ci | |
- name: Build plugin | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
run: npm run build | |
- name: Create ZIP file | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
run: wp dist-archive . ./media-experiments.zip | |
- name: Delete existing release | |
uses: actions/github-script@v7 | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const response = await github.rest.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: "nightly" | |
}); | |
github.rest.repos.deleteRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: response.data.id, | |
}); | |
- name: Tag current commit | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "swissspidy-bot" | |
git push origin :refs/tags/nightly | |
git tag -f nightly | |
git push origin --tags | |
- name: Publish Release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
if: ${{ env.CURRENT_TAG != 'nightly' }} | |
with: | |
tag_name: nightly | |
name: Nightly Build | |
target_commitish: ${{ github.ref }} | |
draft: false | |
prerelease: true | |
generate_release_notes: true | |
files: | | |
media-experiments.zip | |
fail_on_unmatched_files: true |