-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow only newer versions in the deployment
- Loading branch information
Showing
2 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,29 @@ jobs: | |
create-signed-phar-file: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout HEAD | ||
uses: actions/[email protected] | ||
|
||
# Allow only newer versions | ||
- name: Collect versions | ||
run: | | ||
# extract tag part of github.ref | ||
PUSHED_VERSION=$(cut -d'/' -f3 <<< "$GITHUB_REF") | ||
LATEST_RELEASED_VERSION=$(curl -s https://raw.githubusercontent.com/netz98/n98-magerun2/master/version.txt | tr -d '[:space:]') | ||
echo "pushed_version=$PUSHED_VERSION" >> $GITHUB_ENV | ||
echo "latest_released_version=$LATEST_RELEASED_VERSION" >> $GITHUB_ENV | ||
- uses: jackbilestech/[email protected] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
head: '${{ env.pushed_version }}' | ||
base: '${{ env.latest_released_version }}' | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
tools: composer:2 | ||
php-version: '7.4' | ||
|
||
- name: Checkout HEAD | ||
uses: actions/[email protected] | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
|
@@ -67,14 +81,6 @@ jobs: | |
name: n98-magerun2.phar | ||
path: . | ||
|
||
- name: rename phar file (deploy test) | ||
if: github.ref == 'refs/heads/deploy' | ||
run: | | ||
TAG=deploy-test-1.2.3 | ||
mv n98-magerun2.phar n98-magerun2-${TAG}.phar | ||
mv n98-magerun2.phar.asc n98-magerun2-${TAG}.phar.asc | ||
ls -l | ||
- name: rename phar file (develop / unstable) | ||
if: github.ref == 'refs/heads/develop' | ||
run: | | ||
|
@@ -87,6 +93,7 @@ jobs: | |
run: | | ||
# get tag part of github.ref | ||
TAG=$(cut -d'/' -f3 <<< "$GITHUB_REF") | ||
LATEST_VERSION=$(curl -s https://raw.githubusercontent.com/netz98/n98-magerun2/master/version.txt | tr -d '[:space:]') | ||
cp n98-magerun2.phar n98-magerun2-${TAG}.phar | ||
cp n98-magerun2.phar.asc n98-magerun2-${TAG}.phar.asc | ||
mv n98-magerun2.phar n98-magerun2-latest.phar | ||
|
@@ -125,7 +132,7 @@ jobs: | |
update-dist-repo: | ||
runs-on: ubuntu-latest | ||
needs: [ "create-signed-phar-file" ] | ||
needs: [ "check-semantic-versioning", "create-signed-phar-file" ] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Checkout HEAD | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,5 +27,4 @@ phpunit.xml | |
super-linter.log | ||
|
||
# Act | ||
act.env | ||
act.secrets | ||
/act* |