-
Notifications
You must be signed in to change notification settings - Fork 0
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
6a5f399
commit 36282e3
Showing
1 changed file
with
69 additions
and
7 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,3 +1,16 @@ | ||
# 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. | ||
# | ||
# Double check the "project" and "deploy_to" properties in the "Create Octopus Release" step | ||
# match your Octopus projects and environments. | ||
# | ||
# Get a trial Octopus instance from https://octopus.com/start | ||
|
||
name: Ruby Build | ||
'on': | ||
workflow_dispatch: {} | ||
|
@@ -6,7 +19,7 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
- name: Set up Ruby | ||
|
@@ -31,6 +44,22 @@ jobs: | |
- name: Install Dependencies | ||
run: bundle install | ||
shell: bash | ||
- name: List Dependencies | ||
run: gem dep > dependencies.txt | ||
shell: bash | ||
- name: Collect Dependencies | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Dependencies | ||
path: dependencies.txt | ||
- name: List Dependency Updates | ||
run: gem outdated > dependencyUpdates.txt | ||
shell: bash | ||
- name: Collect Dependency Updates | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Dependencies Updates | ||
path: dependencyUpdates.txt | ||
- name: Test | ||
run: gem install rspec_junit_formatter; rspec --format RspecJunitFormatter --out results.xml | ||
shell: bash | ||
|
@@ -49,7 +78,7 @@ jobs: | |
octo pack \ | ||
--basePath ${SOURCEPATH} \ | ||
--outFolder ${OUTPUTPATH} \ | ||
--id randomquotes \ | ||
--id RandomQuotes-Ruby \ | ||
--version ${{ steps.determine_version.outputs.semVer }} \ | ||
--format zip \ | ||
--overwrite \ | ||
|
@@ -70,19 +99,52 @@ jobs: | |
--include '**/*.txt' \ | ||
--include '**/*.Procfile' | ||
shell: bash | ||
- name: Tag Release | ||
uses: mathieudutour/[email protected] | ||
with: | ||
custom_tag: ${{ steps.determine_version.outputs.semVer }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- 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' | ||
- 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-Ruby.${{ steps.determine_version.outputs.semVer }}.zip | ||
asset_name: RandomQuotes-Ruby.${{ steps.determine_version.outputs.semVer }}.zip | ||
asset_content_type: application/octet-stream | ||
- 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: | ||
packages: randomquotes.${{ steps.determine_version.outputs.semVer }}.zip | ||
packages: RandomQuotes-Ruby.${{ steps.determine_version.outputs.semVer }}.zip | ||
overwrite_mode: OverwriteExisting | ||
- name: Generate Octopus Deploy build information | ||
uses: OctopusDeploy/push-build-information-action@v1 | ||
env: | ||
OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_API_TOKEN }} | ||
OCTOPUS_HOST: ${{ secrets.OCTOPUS_SERVER_URL }} | ||
with: | ||
version: ${{ steps.determine_version.outputs.semVer }} | ||
packages: RandomQuotes-Ruby | ||
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: Random Quotes | ||
project: RandomQuotes-Ruby | ||
server: ${{ secrets.OCTOPUS_SERVER_URL }} | ||
deploy_to: Dev | ||
packages: randomquotes:${{ steps.determine_version.outputs.semVer }} | ||
deploy_to: Development | ||
packages: RandomQuotes-Ruby:${{ steps.determine_version.outputs.semVer }} |