Skip to content

Commit a7c7517

Browse files
committed
add release workflow
it took many tries
1 parent 33a8726 commit a7c7517

4 files changed

Lines changed: 64 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish new release on GitHub
2+
3+
on:
4+
# Run automatically when a new tag is created
5+
push:
6+
tags:
7+
- 'v0.*' # alpha
8+
- 'v1.*' # release
9+
10+
11+
jobs:
12+
build:
13+
uses: ./.github/workflows/webpack.yml
14+
15+
release:
16+
runs-on: ubuntu-22.04
17+
18+
needs: build
19+
20+
strategy:
21+
matrix:
22+
node-version: [18.x]
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Download Artifact
28+
uses: actions/download-artifact@v3
29+
with:
30+
name: codam-web-greeter
31+
path: ./artifacts
32+
33+
- name: Display structure of downloaded files
34+
run: ls -R
35+
working-directory: ./artifacts
36+
37+
- name: Create Release
38+
uses: softprops/action-gh-release@v1
39+
if: startsWith(github.ref, 'refs/tags/v')
40+
with:
41+
files: ./artifacts/codam-web-greeter.zip
42+
tag_name: ${{ github.ref }}
43+
generate_release_notes: true
44+
draft: false
45+
prerelease: true
46+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/webpack.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: NodeJS with Webpack
33
on:
44
push:
55
branches: [ "main" ]
6+
tags-ignore:
7+
- 'v0.*' # alpha
8+
- 'v1.*' # release
69
pull_request:
710
branches: [ "main" ]
11+
workflow_call:
812

913
jobs:
1014
build:
@@ -15,7 +19,7 @@ jobs:
1519
node-version: [18.x]
1620

1721
steps:
18-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
1923

2024
- name: Use Node.js ${{ matrix.node-version }}
2125
uses: actions/setup-node@v3
@@ -33,3 +37,14 @@ jobs:
3337
- name: Build codam-web-greeter
3438
run: |
3539
make build
40+
41+
- name: Create zip file from dist folder
42+
run: |
43+
zip -r codam-web-greeter.zip dist
44+
45+
- name: Upload Artifact
46+
uses: actions/upload-artifact@v3
47+
with:
48+
name: codam-web-greeter
49+
path: codam-web-greeter.zip
50+
retention-days: 1

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codam-web-greeter",
3-
"version": "0.0.1",
3+
"version": "0.0.9",
44
"description": "LightDM greeter theme for Codam Coding College, compatible with nody-greeter and web-greeter",
55
"main": "main.js",
66
"scripts": {

0 commit comments

Comments
 (0)