-
Notifications
You must be signed in to change notification settings - Fork 12
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
4f1a155
commit 392c517
Showing
1 changed file
with
32 additions
and
33 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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# The following workflow provides an opinionated template you can customize for your own needs. | ||
# | ||
# If you are not an Octopus user, the "Push to Octopus", "Generate Octopus Deploy build information", | ||
# and "Create Octopus Release" steps can be safely deleted. | ||
# | ||
# To configure Octopus, set the OCTOPUS_API_TOKEN secret to the Octopus API key, and | ||
# set the OCTOPUS_SERVER_URL secret to the Octopus URL. | ||
# | ||
|
@@ -8,28 +11,28 @@ | |
# | ||
# Get a trial Octopus instance from https://octopus.com/start | ||
|
||
name: PHP Build | ||
'on': | ||
workflow_dispatch: {} | ||
push: {} | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected].7 | ||
uses: gittools/actions/gitversion/[email protected].14 | ||
with: | ||
versionSpec: 5.x | ||
- id: determine_version | ||
name: Determine Version | ||
uses: gittools/actions/gitversion/[email protected].7 | ||
uses: gittools/actions/gitversion/[email protected].14 | ||
with: | ||
additionalArguments: /overrideconfig mode=Mainline | ||
- name: Install Octopus Deploy CLI | ||
uses: OctopusDeploy/install-octocli@v1.1.1 | ||
uses: OctopusDeploy/install-octopus-cli-action@v1 | ||
with: | ||
version: latest | ||
- name: Install Dependencies | ||
|
@@ -52,7 +55,7 @@ jobs: | |
name: Dependencies Updates | ||
path: dependencyUpdates.txt | ||
- name: Test | ||
run: vendor/bin/phpunit --log-junit results.xml tests || true | ||
run: vendor/bin/phpunit --log-junit results.xml tests | ||
shell: bash | ||
- if: always() | ||
name: Report | ||
|
@@ -95,51 +98,47 @@ jobs: | |
with: | ||
custom_tag: ${{ steps.determine_version.outputs.semVer }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
id: create_release | ||
- id: create_release | ||
name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.determine_version.outputs.semVer }}+run${{ github.run_number }}-attempt${{ github.run_attempt }} | ||
release_name: Release ${{ steps.determine_version.outputs.semVer }} Run ${{ github.run_number }} Attempt ${{ github.run_attempt }} | ||
draft: 'false' | ||
prerelease: 'false' | ||
- env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
name: Upload Release Asset | ||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: RandomQuotes-PHP.${{ steps.determine_version.outputs.semVer }}.zip | ||
asset_name: RandomQuotes-PHP.${{ steps.determine_version.outputs.semVer }}.zip | ||
asset_content_type: application/octet-stream | ||
- name: Push to Octopus | ||
uses: OctopusDeploy/[email protected] | ||
- name: Push packages to Octopus Deploy | ||
uses: OctopusDeploy/push-package-action@v2 | ||
env: | ||
OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_API_TOKEN }} | ||
OCTOPUS_HOST: ${{ secrets.OCTOPUS_SERVER_URL }} | ||
with: | ||
api_key: ${{ secrets.OCTOPUS_API_TOKEN }} | ||
packages: RandomQuotes-PHP.${{ steps.determine_version.outputs.semVer }}.zip | ||
server: ${{ secrets.OCTOPUS_SERVER_URL }} | ||
overwrite_mode: OverwriteExisting | ||
- name: Generate Octopus Deploy build information | ||
uses: xo-energy/[email protected] | ||
uses: OctopusDeploy/push-build-information-action@v1 | ||
env: | ||
OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_API_TOKEN }} | ||
OCTOPUS_HOST: ${{ secrets.OCTOPUS_SERVER_URL }} | ||
with: | ||
octopus_api_key: ${{ secrets.OCTOPUS_API_TOKEN }} | ||
octopus_project: RandomQuotes-PHP | ||
octopus_server: ${{ secrets.OCTOPUS_SERVER_URL }} | ||
push_version: ${{ steps.determine_version.outputs.semVer }} | ||
push_package_ids: RandomQuotes-PHP | ||
push_overwrite_mode: OverwriteExisting | ||
output_path: octopus | ||
version: ${{ steps.determine_version.outputs.semVer }} | ||
packages: RandomQuotes-PHP | ||
overwrite_mode: OverwriteExisting | ||
- name: Create Octopus Release | ||
uses: OctopusDeploy/create-release-action@v1.1.1 | ||
uses: OctopusDeploy/create-release-action@v1 | ||
with: | ||
api_key: ${{ secrets.OCTOPUS_API_TOKEN }} | ||
project: RandomQuotes-PHP | ||
server: ${{ secrets.OCTOPUS_SERVER_URL }} | ||
deploy_to: Dev | ||
deploy_to: Development | ||
packages: RandomQuotes-PHP:${{ steps.determine_version.outputs.semVer }} | ||
name: PHP Build | ||
'on': | ||
workflow_dispatch: {} | ||
push: {} |