Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new workflow to create a release on tag pushes #95

Merged
merged 6 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ jobs:

windows-build:
needs: check-workflows
uses: ./.github/workflows/windows-build.yml
uses: ./.github/workflows/windows-build.yml
with:
upload-artifacts: false
45 changes: 45 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create a Release

on:
push:
tags:
- v*.*.*

jobs:
check-workflows:
uses: ./.github/workflows/check-workflows.yml

build-artifacts:
needs: check-workflows
uses: ./.github/workflows/windows-build.yml
with:
upload-artifacts: true

create-release:
needs: build-artifacts
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- name: Create a Release
run: gh release create ${{ github.ref }} -F ReleaseNote.md

- name: Download ocesql.exe
uses: actions/download-artifact@v4
with:
name: ocesql.exe

- name: Download ocesql4j.jar
uses: actions/download-artifact@v4
with:
name: ocesql4j.jar

- name: Publish artifacts
run: |
gh release upload ${{ github.ref_name }} ocesql.exe --clobber
gh release upload ${{ github.ref_name }} ocesql4j.jar --clobber
21 changes: 20 additions & 1 deletion .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Windows build

on:
workflow_call:
inputs:
upload-artifacts:
description: 'Upload artifacts'
required: true
type: boolean

permissions:
contents: read
Expand Down Expand Up @@ -94,4 +99,18 @@ jobs:
run: |
fc /b .\sample-result ..\win\sample-correct > test-result
findstr "no differences encountered" test-result
shell: cmd
shell: cmd

- name: Upload ocesql.exe
if: ${{ inputs.upload-artifacts }}
uses: actions/upload-artifact@v4
with:
name: ocesql.exe
path: win\x64\Release\ocesql.exe

- name: Upload ocesql.exe
if: ${{ inputs.upload-artifacts }}
uses: actions/upload-artifact@v4
with:
name: ocesql4j.jar
path: dblibj\target\scala-2.13\ocesql4j.jar
1 change: 1 addition & 0 deletions ReleaseNote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a sample release
Loading