generated from Ed-Fi-Exchange-OSS/Template-for-GitHub
-
Notifications
You must be signed in to change notification settings - Fork 13
53 lines (48 loc) · 1.62 KB
/
on-merge-to-main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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: On Merge to Main
on:
push:
branches:
- main
env:
API_URL: https://api.github.com/repos/${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.PAT_ATTACH_TO_RELEASE }}
jobs:
create-pre-releases:
name: Create Pre-Releases
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
working-directory: eng/version
steps:
- name: Checkout the Repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
# Need full Git history for calculating the version number
fetch-depth: 0w
- name: Create Meadowlark Pre-Release
run: |
npm install
$version = $(node ./bump.js)
if ($LASTEXITCODE -ne 0) {
throw 'Unable to retrieve version number'
}
"Creating pre-release $version" | Out-Host
$body = @{
tag_name = "$version"
target_commitish = "main"
name = $version
body = ""
draft = $false
prerelease = $true
generate_release_notes = $false
} | ConvertTo-Json
$headers = @{
Accept = "application/vnd.github+json"
Authorization = "Bearer ${{ env.GITHUB_TOKEN }}"
}
Invoke-RestMethod -Method POST -Uri ${{ env.API_URL }}/releases -Body $body -Headers $headers