-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5799ea2
commit 1e14410
Showing
2 changed files
with
53 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: deploy new php version | ||
|
||
# Only trigger, when the build workflow succeeded | ||
on: | ||
workflow_run: | ||
workflows: ["vaas-php-ci"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
name: deploy new php version | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: extract version | ||
if: startsWith(github.ref, 'refs/tags/php') | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/php}" >> $GITHUB_ENV | ||
echo $RELEASE_VERSION | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: publish on site repo | ||
if: startsWith(github.ref, 'refs/tags/php') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
working-directory: php/src/vaas | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Version Bot" | ||
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"$RELEASE_VERSION\"/g" ./composer.json | ||
cp ../../../Readme.md . | ||
git init | ||
git add . | ||
git commit -m"publish php $RELEASE_VERSION" | ||
git branch -M main | ||
git tag v$RELEASE_VERSION | ||
git remote add origin https://ata-no-one:[email protected]/GDATASoftwareAG/vaas-php | ||
git push origin main --tags --force | ||
- name: sync packagist | ||
if: startsWith(github.ref, 'refs/tags/php') | ||
env: | ||
PACKAGIST_API_TOKEN: ${{ secrets.PACKAGIST_API_TOKEN }} | ||
run: curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=gdatacyberdefense&apiToken=$PACKAGIST_API_TOKEN" -d'{"repository":{"url":"https://packagist.org/packages/gdata/vaas"}}' | ||
|
||
- name: Microsoft Teams Notification | ||
uses: skitionek/notify-microsoft-teams@master | ||
if: failure() | ||
with: | ||
webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }} | ||
overwrite: "{title: `Failed workflow on for VaaS-SDK ${workflow}`, sections: [{activityTitle: 'build failed', activitySubtitle: `Failed workflow on for VaaS-SDK ${workflow}`, activityImage: 'https://adaptivecards.io/content/cats/3.png'}], themeColor: '#ff0000'}" |
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 |
---|---|---|
|
@@ -84,43 +84,6 @@ jobs: | |
run: php GetVerdictByHash.php | ||
working-directory: php/examples/VaasExample | ||
|
||
deploy: | ||
name: Deploy new php version | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: extract version | ||
if: startsWith(github.ref, 'refs/tags/php') | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/php}" >> $GITHUB_ENV | ||
echo $RELEASE_VERSION | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: publish on site repo | ||
if: startsWith(github.ref, 'refs/tags/php') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
working-directory: php/src/vaas | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Version Bot" | ||
sed -i "s/\"version\": \"0.0.0\"/\"version\": \"$RELEASE_VERSION\"/g" ./composer.json | ||
cp ../../../Readme.md . | ||
git init | ||
git add . | ||
git commit -m"publish php $RELEASE_VERSION" | ||
git branch -M main | ||
git tag v$RELEASE_VERSION | ||
git remote add origin https://ata-no-one:[email protected]/GDATASoftwareAG/vaas-php | ||
git push origin main --tags --force | ||
- name: sync packagist | ||
if: startsWith(github.ref, 'refs/tags/php') | ||
env: | ||
PACKAGIST_API_TOKEN: ${{ secrets.PACKAGIST_API_TOKEN }} | ||
run: curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=gdatacyberdefense&apiToken=$PACKAGIST_API_TOKEN" -d'{"repository":{"url":"https://packagist.org/packages/gdata/vaas"}}' | ||
|
||
- name: Microsoft Teams Notification | ||
uses: skitionek/notify-microsoft-teams@master | ||
if: failure() | ||
|