Skip to content

Commit

Permalink
- adds a workflow to automate github releases on tags
Browse files Browse the repository at this point in the history
- updates docker workflow to support nightly and releases
- adds a changelog file
- adds a description to the docker file
  • Loading branch information
baywet committed Apr 20, 2021
1 parent 458edef commit c110bb9
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 5 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create GitHub release
on:
push:
tags: ['v*']

jobs:
publish_binaries:
name: Publish binaries
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
- win-x64
- win-x86
- linux-x64
- osx-x64
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Publish ${{ matrix.architecture }}
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -r ${{ matrix.architecture }} -o ./${{ matrix.architecture }}
- name: Archive Release ${{ matrix.architecture }}
uses: thedoctor0/zip-release@master
with:
filename: './${{ matrix.architecture }}.zip'
path: './${{ matrix.architecture }}'
- uses: actions/upload-artifact@v2
with:
name: binaries-${{ matrix.architecture }}
path: ./${{ matrix.architecture }}.zip
create_release:
name: Create Release
needs: [publish_binaries]
environment:
name: gh_releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: output
- name: Release
uses: anton-yurchenko/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "false"
PRE_RELEASE: "false"
CHANGELOG_FILE: "CHANGELOG.md"
ALLOW_EMPTY_CHANGELOG: "true"
ALLOW_TAG_PREFIX: "true"
with:
args: |
output/binaries-*/*.zip
20 changes: 18 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Publish Docker image
on:
push:
branches: [main]
tags: ['v*']
paths: ['src/**', '.github/workflows/**']
jobs:
push_to_registry:
Expand All @@ -18,8 +19,23 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
- name: Push to GitHub Packages
- run: |
$version = $Env:BRANCH_NAME -replace "refs/tags/v",""
echo "::set-output name=version::${version}"
shell: pwsh
id: getversion
if: contains(github.ref, 'refs/tags/v')
env:
BRANCH_NAME: ${{ github.ref }}
- name: Push to GitHub Packages - Nightly
if: contains(github.ref, 'refs/head/main')
uses: docker/build-push-action@v2
with:
push: true
tags: docker.pkg.github.com/microsoft/kiota/generator:latest
tags: docker.pkg.github.com/microsoft/kiota/generator:nightly
- name: Push to GitHub Packages - Release
if: contains(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v2
with:
push: true
tags: docker.pkg.github.com/microsoft/kiota/generator:latest,docker.pkg.github.com/microsoft/kiota/generator:${{ steps.getversion.outputs.version }}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.0.1] - 2021-04-20

### Added

- Initial GitHub release
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR /app

COPY ./src ./kiota/src
COPY ./tests ./kiota/tests
COPY ./kiota.sln ./kiota
WORKDIR /app/kiota
RUN dotnet publish ./src/kiota/kiota.csproj -c Release

Expand All @@ -14,4 +12,7 @@ COPY --from=build-env /app/kiota/src/kiota/bin/Release/net5.0 ./

VOLUME /app/output
VOLUME /app/openapi.yml
ENTRYPOINT ["dotnet", "kiota.dll"]
ENTRYPOINT ["dotnet", "kiota.dll"]
LABEL description="# Welcome to Kiota Generator \
To start generating SDKs checkout [the getting started documentation](https://github.com/microsoft/kiota/#running-kiota-with-docker) \
[Source dockerfile](https://github.com/microsoft/kiota/blob/main/releases/Dockerfile)"

0 comments on commit c110bb9

Please sign in to comment.