Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
caothu159 authored May 30, 2024
1 parent 93e37d4 commit c11818b
Showing 1 changed file with 5 additions and 63 deletions.
68 changes: 5 additions & 63 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,70 +18,12 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions: {}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ${{matrix.operating-system}}
strategy:
fail-fast: false
matrix:
# operating-system: [ubuntu-latest]
operating-system: [ubuntu-22.04, ubuntu-20.04]
# php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.3']
php-versions: ['8.1', '8.2', '8.3']
name: Build and push package using PHP ${{ matrix.php-versions }} with ${{ matrix.operating-system }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl #optional
ini-values: "post_max_size=256M" #optional

- name: Install dependencies
run: |
mkdir -p /tmp/test
cd /tmp/test
composer require diepxuan/module-autologin
- name: Setup Node.js
if: false
uses: actions/setup-node@v3
with:
node-version: '16'
check-latest: true

- name: Install NPM dependencies
if: false
run: npm install

- name: Compile assets for production
if: false
run: npm run build

- name: Push to repository
if: false
run: |
if [ "$(git status --porcelain=v1 2>/dev/null | wc -l)" != "0" ]; then
# git add src/debian/control
git commit -m "Update packages from ${{ matrix.operating-system }} at $(date +'%d-%m-%y')" &&
git push ||
git stash &&
git pull --rebase &&
git stash apply &&
git push || true
fi
- name: Version update
run: |
version=$(git describe --tags --abbrev=0 | tr -d . | awk -F. -v OFS=. '{$NF += 1 ; print}' | sed 's/\(.\)/\1./g; s/\.$//')
git tag $version
git push --tags
git tag | xargs -L 1
git tag | xargs -L 1 | tac | awk 'NR > 3' | xargs git push $(git remote -v | grep "push" | cut -f1) --delete || true
permissions:
contents: write
uses: diepxuan/.github/workflows/php-module-build.yml@main

0 comments on commit c11818b

Please sign in to comment.