Skip to content

Commit 31c0c39

Browse files
committed
Update release.yml and update.yml
1 parent c5d348f commit 31c0c39

File tree

2 files changed

+41
-23
lines changed

2 files changed

+41
-23
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
11
name: release
2-
run-name: Update library files
32

4-
# TODO: Figure out a release workflow.
5-
on: workflow_dispatch
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
67

78
jobs:
89
release:
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: actions/checkout@v4
12-
with:
13-
submodules: true
14-
- uses: ruby/setup-ruby@v1
15-
with:
16-
bundler-cache: true
17-
- run: bundle exec rake
18-
continue-on-error: true
19-
- run: bundle exec rake build
20-
- name: Check for changes
21-
id: dist_updated
22-
run: git diff --quiet HEAD -- dist
23-
- name: Setup git user
13+
- name: Package library
2414
run: |
25-
git config user.name github-actions
26-
git config user.email [email protected]
27-
- name: Push changes
28-
if: ${{ steps.dist_updated.outcome == 'failure' }}
29-
run: |
30-
git add dist
31-
git commit -m "Update library files"
32-
git push
15+
tar -zcf dfhack-lua-definitions-$(git tag --points-at HEAD).tar.gz dist
16+
zip -9qr dfhack-lua-definitions-$(git tag --points-at HEAD).zip dist
17+
- name: Create a new release
18+
run: gh release create $(git tag --points-at HEAD) dfhack-lua-definitions-$(git tag --points-at HEAD).*

.github/workflows/update.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: update
2+
run-name: Update library files
3+
4+
# TODO: Figure out a release workflow.
5+
on: workflow_dispatch
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
submodules: true
14+
- uses: ruby/setup-ruby@v1
15+
with:
16+
bundler-cache: true
17+
- run: bundle exec rake
18+
continue-on-error: true
19+
- run: bundle exec rake build
20+
- name: Check for changes
21+
id: dist_updated
22+
run: git diff --quiet HEAD -- dist
23+
- name: Setup git user
24+
run: |
25+
git config user.name github-actions
26+
git config user.email [email protected]
27+
- name: Push changes
28+
if: ${{ steps.dist_updated.outcome == 'failure' }}
29+
run: |
30+
git add dist
31+
git commit -m "Update library files"
32+
git push

0 commit comments

Comments
 (0)