Skip to content

Commit

Permalink
Modify release CI to run in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
dudoslav committed Oct 18, 2024
1 parent 632a1da commit 022783e
Showing 1 changed file with 63 additions and 62 deletions.
125 changes: 63 additions & 62 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Release

on:
workflow_dispatch:
pull_request:
push:
branches:
- dev
Expand Down Expand Up @@ -160,65 +161,65 @@ jobs:
exit 1
fi
Publish-Release:
needs:
- Test-Release-Artifacts
- Package-Source-Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download release artifacts
uses: actions/download-artifact@v3
with:
name: release
path: dist
- name: Publish release artifacts
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const path = require('path');
const repo = context.repo;
const release = await github.rest.repos.getReleaseByTag({
owner: repo.owner,
repo: repo.repo,
tag: "${{ github.ref_name }}"
});
const globber = await glob.create('dist/*');
for await (const file of globber.globGenerator()) {
await github.rest.repos.uploadReleaseAsset({
owner: repo.owner,
repo: repo.repo,
release_id: release.data.id,
headers: {
'content-type': 'application/octet-stream',
'content-length': fs.statSync(file).size
},
name: path.basename(file),
data: fs.readFileSync(file)
});
}
Generate-Release-List:
needs:
- Publish-Release
uses: ./.github/workflows/append-release-cmake.yml
with:
ref: ${{ github.ref_name }}

Create-Issue-On-Fail:
permissions:
issues: write
runs-on: ubuntu-latest
needs: Publish-Release
if: (failure() || cancelled()) && github.event_name == 'push'
steps:
# The open-issue action requires to clone the repository.
- name: Checkout TileDB
uses: actions/checkout@v4
- name: Create Issue if Build Fails
uses: TileDB-Inc/github-actions/open-issue@main
with:
name: Release failed
label: release
assignee: KiterLuc,teo-tsirpanis,davisp
# Publish-Release:
# needs:
# - Test-Release-Artifacts
# - Package-Source-Release
# if: startsWith(github.ref, 'refs/tags/')
# runs-on: ubuntu-latest
# steps:
# - name: Download release artifacts
# uses: actions/download-artifact@v3
# with:
# name: release
# path: dist
# - name: Publish release artifacts
# uses: actions/github-script@v6
# with:
# script: |
# const fs = require('fs');
# const path = require('path');
# const repo = context.repo;
# const release = await github.rest.repos.getReleaseByTag({
# owner: repo.owner,
# repo: repo.repo,
# tag: "${{ github.ref_name }}"
# });
# const globber = await glob.create('dist/*');
# for await (const file of globber.globGenerator()) {
# await github.rest.repos.uploadReleaseAsset({
# owner: repo.owner,
# repo: repo.repo,
# release_id: release.data.id,
# headers: {
# 'content-type': 'application/octet-stream',
# 'content-length': fs.statSync(file).size
# },
# name: path.basename(file),
# data: fs.readFileSync(file)
# });
# }
#
# Generate-Release-List:
# needs:
# - Publish-Release
# uses: ./.github/workflows/append-release-cmake.yml
# with:
# ref: ${{ github.ref_name }}
#
# Create-Issue-On-Fail:
# permissions:
# issues: write
# runs-on: ubuntu-latest
# needs: Publish-Release
# if: (failure() || cancelled()) && github.event_name == 'push'
# steps:
# # The open-issue action requires to clone the repository.
# - name: Checkout TileDB
# uses: actions/checkout@v4
# - name: Create Issue if Build Fails
# uses: TileDB-Inc/github-actions/open-issue@main
# with:
# name: Release failed
# label: release
# assignee: KiterLuc,teo-tsirpanis,davisp

0 comments on commit 022783e

Please sign in to comment.