Release 10.3.1 #45
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
name: Create release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pull code | |
uses: actions/checkout@v4 | |
- name: Use .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Build packages | |
run: | | |
set -xe | |
source_directory=src | |
release_directory=releases | |
pack_flags="--configuration Release --output $release_directory /p:ContinuousIntegrationBuild=true" | |
dotnet pack $pack_flags "$source_directory\\Chr.Avro" | |
dotnet pack $pack_flags "$source_directory\\Chr.Avro.Binary" | |
dotnet pack $pack_flags "$source_directory\\Chr.Avro.Cli" | |
dotnet pack $pack_flags "$source_directory\\Chr.Avro.Codegen" | |
dotnet pack $pack_flags "$source_directory\\Chr.Avro.Confluent" | |
dotnet pack $pack_flags "$source_directory\\Chr.Avro.Json" | |
shell: bash | |
- name: Draft GitHub release | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const fs = require('fs').promises; | |
const releaseDirectory = './releases'; | |
const release = await github.rest.repos.createRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
// strip refs/tags/ prefix if present, otherwise release download links break: | |
tag_name: process.env.GITHUB_REF.replace(/^(?:.+\/)?([^\/]+)$/, '$1'), | |
target_commitish: context.sha, | |
// maintainer will add notes and publish: | |
draft: true | |
}); | |
await Promise.all((await fs.readdir(releaseDirectory)).map(async file => { | |
await github.rest.repos.uploadReleaseAsset({ | |
data: await fs.readFile(`${releaseDirectory}/${file}`), | |
name: file, | |
owner: context.repo.owner, | |
release_id: release.data.id, | |
repo: context.repo.repo | |
}); | |
})); |