-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 2.41 KB
/
compatibility.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: 'Compatibility'
# Controls when the workflow will run
on:
# Triggers the workflow on all pull request events
pull_request: { }
# Trigger workflow for release branches.
push:
branches:
- main
# github.head_ref is only set when the workflow was triggered by a pull_request and it contains the value of the source branch of the PR.
# github.ref_name will than only be used if the workflow was not triggered by a pull_request and it also just contains the branch name.
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
COMPOSER_JSON: |
jobs:
previous_major:
name: 'Distribution - Previous Major'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Try composer installation"
run: |
set -e
sudo apt-get install -y jq
# Set up our test composer.json project.
cp tests/composer.json composer.json
# This gets all version info from composer for Open Social. We then
# use jq to traverse and manipulate the JSON data to find ourselves
# the last stable major version before the current stable major
# version.
PREVIOUS_MAJOR=`composer info -a --format json goalgorilla/open_social | jq '.versions | map(select(contains("-") == false)) | map(split(".")[0] | tonumber) | unique | reverse | .[1]'`
composer require --ignore-platform-reqs goalgorilla/open_social:^$PREVIOUS_MAJOR goalgorilla/open_social_dev:dev-$BRANCH_NAME
current_major:
name: 'Distribution - Current Major'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Try composer installation"
run: |
set -e
sudo apt-get install -y jq
# Set up our test composer.json project.
cp tests/composer.json composer.json
# This gets all version info from composer for Open Social. We then
# use jq to traverse and manipulate the JSON data to find ourselves
# the last stable major version before the current stable major
# version.
CURRENT_MAJOR=`composer info -a --format json goalgorilla/open_social | jq '.versions | map(select(contains("-") == false)) | map(split(".")[0] | tonumber) | unique | reverse | .[0]'`
composer require --ignore-platform-reqs goalgorilla/open_social:^$CURRENT_MAJOR goalgorilla/open_social_dev:dev-$BRANCH_NAME