Skip to content

Commit

Permalink
Merge pull request #3 from TangibleInc/feature/local-site-with-wp-now
Browse files Browse the repository at this point in the history
Update GitHub and Bitbucket build pipeline
  • Loading branch information
nicolas-jaussaud authored Oct 24, 2024
2 parents 810d3fc + 9bc6b4c commit b8e8b93
Show file tree
Hide file tree
Showing 9 changed files with 3,159 additions and 2,167 deletions.
54 changes: 33 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
name: Deploy

on:
push:
tags:
- "*.*.*"

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

contents: write
on: push
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v4
with:
node-version: 20
- name: Install
run: npm install
- name: Archive
run: npm run archive
- name: Release
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Create archive
run: bunx roll archive -y
- name: Install pipeline
run: mkdir -p publish && cd publish && git clone https://github.com/tangibleinc/pipeline
- name: Add latest tag as needed
uses: EndBug/latest-tag@latest
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
- name: Before release script
run: bun run publish/pipeline/before-release.ts
- name: Release tag
uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: publish/tangible-fields.zip
body_path: publish/release.md
files: publish/*.zip
- name: Release preview at latest commit
uses: softprops/action-gh-release@v2
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
body_path: publish/release.md
files: publish/*.zip
tag_name: latest
make_latest: true
- name: After release script
run: bun run publish/pipeline/after-release.ts
8 changes: 4 additions & 4 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This uses a consolidated script from https://bitbucket.org/tangibleinc/tangible-pipeline-v2
image: php:7.4-fpm
# See https://github.com/tangibleinc/pipeline
image: php:8.1-fpm
pipelines:
# On every commit
default:
- step:
script:
- curl --silent --location "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/tangibleinc/tangible-pipeline-v2/downloads/run" | bash
- curl -sL "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/tangibleinc/tangible-pipeline-v3/downloads/run" | bash
# On every version tag
tags:
"*":
- step:
script:
- curl --silent --location "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/tangibleinc/tangible-pipeline-v2/downloads/run" | bash
- curl -sL "https://${BB_AUTH_STRING}@api.bitbucket.org/2.0/repositories/tangibleinc/tangible-pipeline-v3/downloads/run" | bash
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
{
"type": "vcs",
"url": "[email protected]:tangibleinc/framework.git"
},
{
"type": "vcs",
"url": "[email protected]:tangibleinc/updater.git"
}
],
"require-dev": {
"phpunit/phpunit": "^9",
"yoast/phpunit-polyfills": "^1.0"
},
"require": {
"tangible/framework": "dev-main"
"tangible/framework": "dev-main",
"tangible/updater": "dev-main"
},
"config": {
"allow-plugins": {
Expand Down
11 changes: 3 additions & 8 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function tangible_fields( $arg = false ) {

public $name = 'tangible_fields';
// Remember to update the version - Expected format: YYYYMMDD
public $version = '20240927';
public $version = '20241024';

// Dynamic methods
function __call( $method = '', $args = [] ) {
Expand All @@ -26,13 +26,8 @@ function __call( $method = '', $args = [] ) {

function load() {

if (!class_exists('tangible\\framework')) {
$module_path = defined('TANGIBLE_FIELDS_IS_PLUGIN')
? __DIR__ . '/vendor/tangible/'
: __DIR__ . '/../';

require_once $module_path . 'framework/index.php';
}
// Parent plugin is expected to load framework
if (!class_exists('tangible\\framework')) return;

$fields = $this;
tangible_fields( $fields );
Expand Down
Loading

0 comments on commit b8e8b93

Please sign in to comment.