Skip to content

Commit 1ea2d83

Browse files
committed
upload source to release
1 parent 522aedd commit 1ea2d83

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,37 @@ jobs:
9696
needs: build
9797
runs-on: ubuntu-latest
9898
steps:
99+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
100+
99101
- name: Download build artifacts
100102
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
101103
with:
102104
path: release
103105
merge-multiple: true
104106

107+
- name: Create source archive
108+
run: |
109+
set -euo pipefail
110+
111+
RAW_TAG="${GITHUB_REF_NAME}"
112+
VERSION="${RAW_TAG#v}"
113+
ARCHIVE_FOLDER="typescript-go-${VERSION}"
114+
ARCHIVE_NAME="${ARCHIVE_FOLDER}-source.zip"
115+
TMP_DIR="$(mktemp -d)"
116+
SOURCE_DIR="${TMP_DIR}/${ARCHIVE_FOLDER}"
117+
118+
mkdir -p "${SOURCE_DIR}"
119+
120+
rsync -a \
121+
--exclude='.git/' \
122+
--exclude='release/' \
123+
--exclude='node_modules/' \
124+
--exclude='testdata/' \
125+
./ "${SOURCE_DIR}/"
126+
127+
mkdir -p release
128+
(cd "${TMP_DIR}" && zip -9 -r "${GITHUB_WORKSPACE}/release/${ARCHIVE_NAME}" "${ARCHIVE_FOLDER}")
129+
105130
- name: Create or update GitHub release
106131
env:
107132
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)