-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.66 KB
/
compile.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
name: Compile source code and release
env:
OUTPUT_BRANCH: release
OUTPUT: wiemantheme.theme.css
on:
push:
branches:
- master
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Compile SCSS
run: npm run compile -- name="${{ github.event.repository.name }}" author="${{ github.repository_owner }}" description="${{ vars.DESCRIPTION }}" source="${{ github.event.repository.html_url }}"
- name: Get version from package.json
id: get_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "Version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Commit changes
run: |
git config --global user.name ${{ github.triggering_actor }}.
git config --global user.email ${{ github.triggering_actor }}@gmail.com
git checkout -b $OUTPUT_BRANCH
find . -type f ! -name "$OUTPUT" -not -path './.git/*' -delete
rm -rf node_modules
git init
git add .
git commit -m "Compile ${{ github.event.repository.name }} SCSS v${{ env.VERSION }} build #${{ github.run_number }}"
git push -f origin $OUTPUT_BRANCH
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.TOKEN }}"
automatic_release_tag: ${{ env.VERSION }}
prerelease: false
title: "${{ github.event.repository.name }} v${{ env.VERSION }}"
files: ${{ env.OUTPUT }}