-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BIA-478] GitHub Actions: Packaging (#172)
- Add github actions workflow to create a pre-release. - Add a new secret SEMANTIC_VERSION to share the version between build and create-pre-release workflows.
- Loading branch information
1 parent
30e642e
commit 92731ef
Showing
2 changed files
with
97 additions
and
1 deletion.
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
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,96 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Licensed to the Ed-Fi Alliance under one or more agreements. | ||
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. | ||
# See the LICENSE and NOTICES files in the project root for more information. | ||
|
||
name: Create Release/Pre-Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseName: | ||
description: 'Release Name' | ||
required: true | ||
default: '<AMT>' | ||
releaseDescription: | ||
description: 'Release Description' | ||
required: true | ||
default: '<Description>' | ||
createRelease: | ||
description: 'Create Release' | ||
required: true | ||
default: 'false' | ||
|
||
env: | ||
BUILD_VERSION: ${{ secrets.SEMANTIC_VERSION }} | ||
CONFIGURATION: "Release" | ||
PUBLISH_FOLDER: "./publish/" | ||
PUBLISH_FDD_ZIP: "EdFi.AnalyticsMiddleTier.zip" | ||
PUBLISH_SCD_ZIP: "EdFi.AnalyticsMiddleTier-win10.x64.zip" | ||
|
||
jobs: | ||
AMT-Create-Release: | ||
runs-on: Ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Caching packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuget- | ||
- name: Publish self-contained deployment | ||
run: | | ||
.\build.ps1 publish -SelfContained ${{ env.CONFIGURATION }} -Version ${{ env.BUILD_VERSION }} -BuildCounter ${{ github.run_number }} | ||
shell: pwsh | ||
|
||
- name: Publish framework-dependent deployment | ||
run: | | ||
.\build.ps1 publish -Configuration ${{ env.CONFIGURATION }} -Version ${{ env.BUILD_VERSION }} -BuildCounter ${{ github.run_number }} | ||
shell: pwsh | ||
|
||
- name: Create Zip file | ||
run: | | ||
.\build.ps1 CreateZip -Configuration ${{ env.CONFIGURATION }} -Version ${{ env.BUILD_VERSION }} -BuildCounter ${{ github.run_number }} | ||
shell: pwsh | ||
|
||
- name: Create pre-release | ||
id: create_pre_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
RELEASE_TAG: ${{ contains( github.event.inputs.createRelease, 'true') && env.BUILD_VERSION || format('{0}-pre-{1}', env.BUILD_VERSION, github.run_id) }} | ||
with: | ||
tag_name: ${{ env.RELEASE_TAG }} | ||
release_name: ${{ env.BUILD_VERSION }} ${{ github.event.inputs.releaseName }} | ||
body: | | ||
${{ github.event.inputs.releaseDescription }} | ||
draft: false | ||
prerelease: ${{ !contains( github.event.inputs.createRelease, 'true') }} | ||
|
||
- name: Upload publish zip | ||
id: upload-publish-zip-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_pre_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ${{ env.PUBLISH_FOLDER }}${{ env.PUBLISH_FDD_ZIP }} | ||
asset_name: ${{ env.PUBLISH_FDD_ZIP }} | ||
asset_content_type: application/zip | ||
|
||
- name: Upload self-contained publish zip | ||
id: upload-publish-self-contained-zip-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_pre_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ${{ env.PUBLISH_FOLDER }}${{ env.PUBLISH_SCD_ZIP }} | ||
asset_name: ${{ env.PUBLISH_SCD_ZIP }} | ||
asset_content_type: application/zip |