Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (100 sloc) 4.21 KB
name: Publish Release
env:
OUTPUT_PATH: ${{ github.workspace }}/.output
DOTNET_VERSION: "3.1.100"
NUGET_SOURCE: "https://api.nuget.org/v3/index.json"
on:
issues:
types: [labeled]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Prepare create release issue action
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Building Action
run: npm i && npm run build
working-directory: ./.github/actions/check-issue
- name: Check issue was release issue
uses: ./.github/actions/check-issue
id: check-issue
with:
token: ${{ secrets.GITHUB_TOKEN }}
label: release-candidate
- name: Building Action
run: npm i && npm run build
if: steps.check-issue.outputs.exists == 'true'
working-directory: ./.github/actions/get-action-id
- name: Get the ID of the Action
uses: ./.github/actions/get-action-id
if: steps.check-issue.outputs.exists == 'true'
id: get-action-id
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download packages
if: steps.check-issue.outputs.exists == 'true'
run: |
echo ${{ steps.get-action-id.outputs.id }}
mkdir ${{ env.OUTPUT_PATH }}
cd ${{ env.OUTPUT_PATH }}
curl https://api.github.com/repos/aaronpowell/FSharp.CosmosDb/actions/runs/${{ steps.get-action-id.outputs.id }}/artifacts --output artifacts.json
downloadUrl=$(cat artifacts.json | jq -c '.artifacts[] | select(.name == "packages") | .archive_download_url' | tr -d '"')
echo $downloadUrl
curl $downloadUrl --output packages.zip --user octocat:${{ secrets.GITHUB_TOKEN }} --verbose --location
unzip packages.zip
ls
- name: Get release version
if: steps.check-issue.outputs.exists == 'true'
working-directory: ${{ env.OUTPUT_PATH }}
run: |
version=$(cat version.txt)
echo "::set-env name=package_version::$version"
- name: Setup Dotnet ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v1
if: steps.check-issue.outputs.exists == 'true'
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Push NuGet Package
if: steps.check-issue.outputs.exists == 'true'
working-directory: ${{ env.OUTPUT_PATH }}
run: |
dotnet nuget push FSharp.CosmosDb.${{ env.package_version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ env.NUGET_SOURCE }}
dotnet nuget push FSharp.CosmosDb.Analyzer.${{ env.package_version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ env.NUGET_SOURCE }}
- name: Get Action sha
if: steps.check-issue.outputs.exists == 'true'
run: |
echo ${{ steps.get-action-id.outputs.id }}
cd ${{ env.OUTPUT_PATH }}
curl https://api.github.com/repos/aaronpowell/FSharp.CosmosDb/actions/runs/${{ steps.get-action-id.outputs.id }} --output run.json
action_sha=$(cat run.json | jq -c '.head_sha' | tr -d '"')
echo "::set-env name=action_sha::$action_sha"
- name: Building Action
run: npm i && npm run build
if: steps.check-issue.outputs.exists == 'true'
working-directory: ./.github/actions/github-release
- name: Cut GitHub Release
uses: ./.github/actions/github-release
if: steps.check-issue.outputs.exists == 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ env.action_sha }}
version: ${{ env.package_version }}
path: ${{ env.OUTPUT_PATH }}
- name: Building Action
run: npm i && npm run build
if: steps.check-issue.outputs.exists == 'true'
working-directory: ./.github/actions/close-issue
- name: Close issue
uses: ./.github/actions/close-issue
if: steps.check-issue.outputs.exists == 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
message: |
The release has been approved and has been
* Deployed to NuGet
* Created as a Release on the repo
* Commit has been tagged
You can’t perform that action at this time.