mirror of
https://github.com/coredns/coredns.git
synced 2026-04-05 11:45:33 -04:00
Update github workflow to release windows builds in zip format. (#7946)
* feat: Add GitHub Actions workflow for drafting releases and update Makefile to build Windows releases as zip archives. Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com> * Generate both tgz and zip for Windows to support any existing workflows. Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com> --------- Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e8db7e155e
commit
92a6ae7079
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: Build release binary
|
- name: Build release binary
|
||||||
run: make -f Makefile.release release
|
run: make -f Makefile.release release
|
||||||
- name: Build release binary sha256
|
- name: Build release binary sha256
|
||||||
run: (cd release; for asset in `ls -A *tgz`; do sha256sum $asset > $asset.sha256; done)
|
run: (cd release; for asset in `ls -A *.tgz *.zip`; do sha256sum $asset > $asset.sha256; done)
|
||||||
- name: Remove hidden section
|
- name: Remove hidden section
|
||||||
run: sed '/+++/,//d' notes/coredns-${{ steps.info.outputs.version}}.md > release.md
|
run: sed '/+++/,//d' notes/coredns-${{ steps.info.outputs.version}}.md > release.md
|
||||||
- name: Log release info
|
- name: Log release info
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
echo ${{ steps.info.outputs.commit }}
|
echo ${{ steps.info.outputs.commit }}
|
||||||
echo ${{ steps.info.outputs.version }}
|
echo ${{ steps.info.outputs.version }}
|
||||||
cat release.md
|
cat release.md
|
||||||
sha256sum release/*.tgz
|
sha256sum release/*.tgz release/*.zip
|
||||||
- name: Draft release
|
- name: Draft release
|
||||||
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
|
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
|
||||||
with:
|
with:
|
||||||
@@ -57,4 +57,6 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
release/*.tgz
|
release/*.tgz
|
||||||
release/*.tgz.sha256
|
release/*.tgz.sha256
|
||||||
|
release/*.zip
|
||||||
|
release/*.zip.sha256
|
||||||
draft: true
|
draft: true
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ tar:
|
|||||||
tar -zcf release/$(NAME)_$(VERSION)_darwin_amd64.tgz -C build/darwin/amd64 $(NAME)
|
tar -zcf release/$(NAME)_$(VERSION)_darwin_amd64.tgz -C build/darwin/amd64 $(NAME)
|
||||||
tar -zcf release/$(NAME)_$(VERSION)_darwin_arm64.tgz -C build/darwin/arm64 $(NAME)
|
tar -zcf release/$(NAME)_$(VERSION)_darwin_arm64.tgz -C build/darwin/arm64 $(NAME)
|
||||||
tar -zcf release/$(NAME)_$(VERSION)_windows_amd64.tgz -C build/windows/amd64 $(NAME).exe
|
tar -zcf release/$(NAME)_$(VERSION)_windows_amd64.tgz -C build/windows/amd64 $(NAME).exe
|
||||||
|
zip -j release/$(NAME)_$(VERSION)_windows_amd64.zip build/windows/amd64/$(NAME).exe
|
||||||
for arch in $(LINUX_ARCH); do \
|
for arch in $(LINUX_ARCH); do \
|
||||||
tar -zcf release/$(NAME)_$(VERSION)_linux_$$arch.tgz -C build/linux/$$arch $(NAME) ;\
|
tar -zcf release/$(NAME)_$(VERSION)_linux_$$arch.tgz -C build/linux/$$arch $(NAME) ;\
|
||||||
done
|
done
|
||||||
@@ -97,15 +98,15 @@ else
|
|||||||
@echo Releasing: $(VERSION)
|
@echo Releasing: $(VERSION)
|
||||||
@$(eval RELEASE:=$(shell curl -s -d '{"tag_name": "v$(VERSION)", "name": "v$(VERSION)"}' -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" "https://api.github.com/repos/$(GITHUB)/$(NAME)/releases" | grep -m 1 '"id"' | tr -cd '[[:digit:]]'))
|
@$(eval RELEASE:=$(shell curl -s -d '{"tag_name": "v$(VERSION)", "name": "v$(VERSION)"}' -H "Authorization: token ${GITHUB_ACCESS_TOKEN}" "https://api.github.com/repos/$(GITHUB)/$(NAME)/releases" | grep -m 1 '"id"' | tr -cd '[[:digit:]]'))
|
||||||
@echo ReleaseID: $(RELEASE)
|
@echo ReleaseID: $(RELEASE)
|
||||||
@( cd release; for asset in `ls -A *tgz`; do \
|
@( cd release; for asset in `ls -A *.tgz *.zip`; do \
|
||||||
echo $$asset; \
|
echo $$asset; \
|
||||||
curl -o /dev/null -X POST \
|
curl -o /dev/null -X POST \
|
||||||
-H "Content-Type: application/gzip" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
-H "Authorization: token ${GITHUB_ACCESS_TOKEN}" \
|
-H "Authorization: token ${GITHUB_ACCESS_TOKEN}" \
|
||||||
--data-binary "@$$asset" \
|
--data-binary "@$$asset" \
|
||||||
"https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}" ; \
|
"https://uploads.github.com/repos/$(GITHUB)/$(NAME)/releases/$(RELEASE)/assets?name=$${asset}" ; \
|
||||||
done )
|
done )
|
||||||
@( cd release; for asset in `ls -A *tgz`; do \
|
@( cd release; for asset in `ls -A *.tgz *.zip`; do \
|
||||||
sha256sum $$asset > $$asset.sha256; \
|
sha256sum $$asset > $$asset.sha256; \
|
||||||
done )
|
done )
|
||||||
@( cd release; for asset in `ls -A *sha256`; do \
|
@( cd release; for asset in `ls -A *sha256`; do \
|
||||||
|
|||||||
Reference in New Issue
Block a user