Skip to content

Commit

Permalink
Add release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lexisother committed Mar 17, 2023
1 parent 8fb4883 commit 8118c75
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/release_body_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Additions

# Changes

# Fixes
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: CI
on: [push, pull_request, workflow_dispatch]
on:
push:
branches:
- '*'
pull_request:
workflow_dispatch:
env:
CI: true

Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release
on:
push:
tags:
- v*

env:
FORCE_COLOR: true

jobs:
release:
name: Build and release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '19.x'
- run: npm i -g pnpm

- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build

- name: Create the distributables
run: node scripts/make-dist-archives.js

- name: Get some values needed for the release
id: release_values
run: |
echo "::set-output name=date::$(date '+%Y-%m-%d')"
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Create the release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ALYX_TOKEN }}
with:
name: ${{ steps.release_values.outputs.tag }}, ${{ steps.release_values.outputs.date }}
draft: true
prerelease: false
body_path: .github/release_body_template.md
files: |
ccloader_${{ steps.release_values.outputs.tag }}_package.tgz
ccloader_${{ steps.release_values.outputs.tag }}_package.zip
ccloader_${{ steps.release_values.outputs.tag }}_quick-install.tgz
ccloader_${{ steps.release_values.outputs.tag }}_quick-install.zip
4 changes: 2 additions & 2 deletions scripts/make-dist-archives.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ async function main() {
createArchive(
format.id,
format.options,
`ccloader_${modloaderMeta.version}_package.${format.fileExt}`,
`ccloader_v${modloaderMeta.version}_package.${format.fileExt}`,
(archive) => archiveAddModloaderFiles(archive, ''),
);

createArchive(
format.id,
format.options,
`ccloader_${modloaderMeta.version}_quick-install.${format.fileExt}`,
`ccloader_v${modloaderMeta.version}_quick-install.${format.fileExt}`,
async (archive) => {
let modloaderDirName = 'ccloader';
let packageJsonData = {
Expand Down

0 comments on commit 8118c75

Please sign in to comment.