Skip to content

Commit

Permalink
chore: add ci action
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Sep 11, 2024
1 parent 20fb45a commit 7f8d65f
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on:
push:
branches:
- main
tags:
- 'v*.*.*'
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Build with Gradle Wrapper
run: chmod +x ./gradlew && ./gradlew build

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: hoshizora-pics-artifact
path: build
retention-days: 1

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: hoshizora-pics-artifact
path: build

- name: Generate Changelog
run: echo "# Good things have arrived" > ${{ github.workspace }}-CHANGELOG.txt

- name: release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
files: build/*

0 comments on commit 7f8d65f

Please sign in to comment.