Skip to content

Commit

Permalink
chore(ci): update some actions version (#106)
Browse files Browse the repository at this point in the history
* ci: update some actions version

* ci: format yaml
  • Loading branch information
lyrixx committed Mar 18, 2024
1 parent 5531674 commit 39ae0e3
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 135 deletions.
46 changes: 23 additions & 23 deletions .github/actions/phar/action.yaml
@@ -1,29 +1,29 @@
name: 'Build the PHAR'
description: 'Build the PHAR for the current commit'
name: "Build the PHAR"
description: "Build the PHAR for the current commit"

runs:
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
using: "composite"
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v4
with:
php-version: "8.1"

- name: Install dependencies (lib)
run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader --classmap-authoritative
shell: bash
- name: Install dependencies (lib)
run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader --classmap-authoritative
shell: bash

- name: Install dependencies (PHAR builder)
run: composer install --prefer-dist --no-progress --optimize-autoloader --classmap-authoritative
shell: bash
working-directory: tools/phar
- name: Install dependencies (PHAR builder)
run: composer install --prefer-dist --no-progress --optimize-autoloader --classmap-authoritative
shell: bash
working-directory: tools/phar

- name: Compile PHAR
run: vendor/bin/box compile
shell: bash
working-directory: tools/phar
- name: Compile PHAR
run: vendor/bin/box compile
shell: bash
working-directory: tools/phar

- name: Ensure PHAR is OK
run: build/jolitypo.phar --version
shell: bash
working-directory: tools/phar
- name: Ensure PHAR is OK
run: build/jolitypo.phar --version
shell: bash
working-directory: tools/phar
32 changes: 16 additions & 16 deletions .github/workflows/build-phar.yml
@@ -1,26 +1,26 @@
name: Build the PHAR

on:
push:
branches: [ "main" ]
push:
branches: ["main"]

permissions:
contents: read
contents: read

jobs:
phar:
name: Create a PHAR and upload it as an artifact
runs-on: ubuntu-latest
phar:
name: Create a PHAR and upload it as an artifact
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
steps:
- uses: actions/checkout@v4

- name: Build the PHAR
uses: ./.github/actions/phar
- name: Build the PHAR
uses: ./.github/actions/phar

- name: Upload the PHAR
uses: actions/upload-artifact@v3
with:
name: 'jolitypo'
path: tools/phar/build/jolitypo.phar
if-no-files-found: error
- name: Upload the PHAR
uses: actions/upload-artifact@v4
with:
name: "jolitypo"
path: tools/phar/build/jolitypo.phar
if-no-files-found: error
62 changes: 31 additions & 31 deletions .github/workflows/ci.yml
@@ -1,40 +1,40 @@
name: Continuous Integration

'on':
push:
branches:
- master
pull_request: ~
"on":
push:
branches:
- master
pull_request: ~

jobs:
ci:
name: Test PHP ${{ matrix.php-version }} ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '8.2'
- '8.3'
composer-flags: ['']
name: ['']
include:
- php-version: 8.1
composer-flags: '--prefer-lowest'
name: '(prefer lowest dependencies)'
ci:
name: Test PHP ${{ matrix.php-version }} ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
composer-flags: [""]
name: [""]
include:
- php-version: 8.1
composer-flags: "--prefer-lowest"
name: "(prefer lowest dependencies)"

steps:
- uses: actions/checkout@v3
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php-version }}'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"

- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test
- name: Run tests
run: composer test
81 changes: 40 additions & 41 deletions .github/workflows/ghpages.yaml
@@ -1,48 +1,47 @@

name: Build the public website, and publish to GitHub Pages

on:
push:
branches: [ "main" ]
push:
branches: ["main"]

permissions:
contents: read
pages: write
id-token: write
contents: read
pages: write
id-token: write

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Checkout
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
tools: castor

- name: Build
run: |
set -x
castor website:install
castor website:wasm:export --pack --build
working-directory: ./website
env:
BASE_URL: "/${{ github.event.repository.name }}"

- name: Upload Artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'website/public'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Setup Pages
uses: actions/configure-pages@v4

- name: Checkout
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
tools: castor

- name: Build
run: |
set -x
castor website:install
castor website:wasm:export --pack --build
working-directory: ./website
env:
BASE_URL: "/${{ github.event.repository.name }}"

- name: Upload Artifact
uses: actions/upload-pages-artifact@v4
with:
path: "website/public"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
48 changes: 24 additions & 24 deletions .github/workflows/release.yml
@@ -1,35 +1,35 @@
name: Attach PHAR to the release

on:
release:
types: [created]
release:
types: [created]

permissions:
contents: write
contents: write

jobs:
phar_release:
name: Create a PHAR and upload it
runs-on: ubuntu-latest
phar_release:
name: Create a PHAR and upload it
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
steps:
- uses: actions/checkout@v4

- name: Build the PHAR
uses: ./.github/actions/phar
- name: Build the PHAR
uses: ./.github/actions/phar

- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.3.2
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload release binary
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./tools/phar/build/jolitypo.phar
asset_name: jolitypo.phar
asset_content_type: application/octet-stream
- name: Upload release binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./tools/phar/build/jolitypo.phar
asset_name: jolitypo.phar
asset_content_type: application/octet-stream

0 comments on commit 39ae0e3

Please sign in to comment.