Skip to content

Commit

Permalink
Update the OctopusDeploy actions to v3 (#56)
Browse files Browse the repository at this point in the history
* Adds the reference to the v3 actions

* Updates the last two actions

* Adds the required 'space'  input

* Update the space name

* Update file paths

* Update the validations to reflect that now a nuspec file is created

* Clean up

* Update README.md to reflect the new version and that we don't need to add the Octopus CLI anymore

* Apply suggestions from code review

Co-authored-by: David Boike <david.boike@gmail.com>

* Add the suffix 'Deploy' to the created package

* Bump the version of the upload-artifact action to v4.3.1

---------

Co-authored-by: David Boike <david.boike@gmail.com>
  • Loading branch information
tamararivera and DavidBoike committed Feb 28, 2024
1 parent 3aec36e commit 1223169
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -53,7 +53,8 @@ jobs:
echo "Outputting all files in the packaging directory:"
$contents = Get-ChildItem -Recurse -Path packaging | Select-Object -Property FullName
echo $contents | Out-String -Width 1000
if (($contents | Measure-Object).Count -ne 6) {
# Directory entry, Metadata.ps1, Octopus-generated nuspec, + 2 assets & 2 nupkg
if (($contents | Measure-Object).Count -ne 7) {
throw "Unexpected number of files in packaging directory"
}
Expand Down Expand Up @@ -97,7 +98,8 @@ jobs:
echo "Outputting all files in the packaging directory:"
$contents = Get-ChildItem -Recurse -Path packaging | Select-Object -Property FullName
echo $contents | Out-String -Width 1000
if (($contents | Measure-Object).Count -ne 9) {
# Same 7 previous entries + 3 new custom metadata files
if (($contents | Measure-Object).Count -ne 10) {
throw "Unexpected number of files in packaging directory"
}
Expand Down
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -20,7 +20,7 @@ Before this action runs:
```yaml
steps:
- name: Deploy
uses: Particular/push-octopus-package-action@v1.0.0
uses: Particular/push-octopus-package-action@v2.0.0
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}
```
Expand All @@ -32,7 +32,7 @@ This is used primarily for [ServiceControl](https://github.com/Particular/Servic
```yaml
steps:
- name: Deploy
uses: Particular/push-octopus-package-action@v1.0.0
uses: Particular/push-octopus-package-action@v2.0.0
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}
additional-metadata-paths: metadata/*.json
Expand All @@ -42,7 +42,7 @@ This is used primarily for [ServiceControl](https://github.com/Particular/Servic
```yaml
steps:
- name: Deploy
uses: Particular/push-octopus-package-action@v1.0.0
uses: Particular/push-octopus-package-action@v2.0.0
with:
octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }}
additional-metadata-paths: |
Expand All @@ -54,7 +54,6 @@ This is used primarily for [ServiceControl](https://github.com/Particular/Servic

This action abstracts the following steps:

1. Installing the Octopus CLI
1. Arranging NuGet packages and other assets on disk for packaging
1. Creating a metadata file to pass version information to Octopus Deploy
1. Packaging the content into a RepoName.Deploy package
Expand Down
35 changes: 21 additions & 14 deletions action.yml
Expand Up @@ -37,11 +37,7 @@ runs:
if: runner.os == 'Windows'
run: Get-ChildItem -Recurse -File deploy -Filter *.cat -ErrorAction:Ignore | foreach {& "$($Env:SIGNTOOL)" verify /pa $_.FullName}
shell: pwsh
- name: Install Octopus CLI
uses: OctopusDeploy/install-octopus-cli-action@v1.2.1
with:
version: latest
- name: Create Octopus Package
- name: Create the files
env:
ADDITIONAL_METADATA_PATHS: ${{ inputs.additional-metadata-paths }}
run: |
Expand Down Expand Up @@ -99,28 +95,39 @@ runs:
Copy-Item $_ packaging
}
}
# Create the Octopus package
octo pack --id="$($RepoName).Deploy" --version="${{env.MinVerVersion}}" --format="nupkg" --basePath="packaging" --outFolder="octopus-package"
shell: pwsh
- name: Create an Octopus NuGet deployment package
id: package
uses: OctopusDeploy/create-nuget-package-action@v3.1.1
with:
package_id: ${{env.PARTICULAR_REPO_NAME}}.Deploy
version: ${{env.MinVerVersion}}
output_folder: octopus-package
base_path: packaging
files: |
**/*.*
nuspec_description: Deployment package for ${{env.PARTICULAR_REPO_NAME}} - not for nuget.org
nuspec_authors: Particular Software
- name: Publish Octopus Package Artifacts
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4.3.1
with:
name: octopus-package
path: octopus-package/*
name: ${{steps.package.outputs.package_filename}}
path: ${{steps.package.outputs.package_file_path}}
retention-days: 1
- name: Push package to Octopus Deploy
uses: OctopusDeploy/push-package-action@v2.2.0
uses: OctopusDeploy/push-package-action@v3.2.1
with:
server: https://deploy.particular.net
api_key: ${{ inputs.octopus-deploy-api-key }}
packages: octopus-package/${{env.PARTICULAR_REPO_NAME}}.Deploy.${{env.MinVerVersion}}.nupkg
packages: ${{steps.package.outputs.package_file_path}}
space: "Default"
- name: Create Octopus Deploy release
uses: OctopusDeploy/create-release-action@v2.1.0
uses: OctopusDeploy/create-release-action@v3.2.1
with:
server: https://deploy.particular.net
api_key: ${{ inputs.octopus-deploy-api-key }}
project: ${{env.PARTICULAR_REPO_NAME}}
release_number: ${{env.MinVerVersion}}
package_version: ${{env.MinVerVersion}}
packages: "GitReleaseManager:0.11.0"
space: "Default"

0 comments on commit 1223169

Please sign in to comment.