Skip to content

Commit 695c32d

Browse files
committed
Build releases from Makefile instead of GitHub workflow.
1 parent 6bdd448 commit 695c32d

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ jobs:
2626
shell: bash
2727
run: |
2828
mv textadept-build/* textadept/src && make -C textadept/src lua
29-
cd textadept/modules/file_diff
30-
make deps && make -j
31-
cd .. && zip -r ../../file_diff.zip file_diff -x "*.zip" "*.h" "*.o" \
32-
"*.def" "*.la" file_diff/.github
29+
make -C textadept/modules/file_diff release
3330
- name: Upload artifacts
3431
uses: actions/upload-artifact@v2
3532
with:
3633
name: artifacts
37-
path: file_diff.zip
34+
path: textadept/modules/file_diff.zip
3835
release:
3936
runs-on: ubuntu-latest
4037
needs: build
@@ -56,7 +53,7 @@ jobs:
5653
tag: latest
5754
allowUpdates: true
5855
body: Latest automated build (ignore github-actions' release date)
59-
artifacts: file_diff.zip
56+
artifacts: textadept/modules/file_diff.zip
6057
token: ${{ secrets.GITHUB_TOKEN }}
6158
cleanup:
6259
runs-on: ubuntu-latest

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,18 @@ diff_match_patch_zip = 7f95b37e554453262e2bcda830724fc362614103.zip
6161
$(diff_match_patch_zip):
6262
wget https://github.com/leutloff/diff-match-patch-cpp-stl/archive/$@
6363
diff_match_patch.h: | $(diff_match_patch_zip) ; unzip -j $| "*/$@"
64+
65+
# Releases.
66+
67+
ifneq (, $(shell hg summary 2>/dev/null))
68+
archive = hg archive -X ".hg*" $(1)
69+
else
70+
archive = git archive HEAD --prefix $(1)/ | tar -xf -
71+
endif
72+
73+
release: file_diff | $(diff_match_patch_zip)
74+
cp $| $<
75+
make -C $< deps && make -C $< -j ta="../../.."
76+
zip -r $<.zip $< -x "*.zip" "*.h" "*.o" "*.def" "*.la" "$</.git*" && rm -r $<
77+
file_diff: ; $(call archive,$@)
78+

0 commit comments

Comments
 (0)