Skip to content

Commit 4d33e6d

Browse files
committed
sha gpg svn
1 parent 5bef1bf commit 4d33e6d

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/automate.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Test Automate Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
gpg-test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
# Create a test file
11+
- name: Create Test File
12+
run: echo "This is a test file for GPG signing" > test-file.txt
13+
14+
# Create a SHA-512 checksum file
15+
- name: Create SHA-512 Checksum File
16+
run: |
17+
name="test-file.txt"
18+
shasum -a 512 "${name}" > "${name}.sha512"
19+
20+
# Verify the SHA-512 checksum
21+
- name: Verify the SHA-512 Checksum
22+
run: |
23+
name="test-file.txt"
24+
shasum -a 512 --check "${name}.sha512"
25+
26+
# Import GPG key using crazy-max/ghaction-import-gpg
27+
- name: Import GPG Key
28+
id: import_gpg
29+
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
30+
with:
31+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
32+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
33+
34+
# Sign the file using the provided GPG command
35+
- name: Detach Sign the File
36+
run: |
37+
name="test-file.txt"
38+
gpg --yes --armor --output "${name}.asc" --detach-sig "${name}"
39+
40+
# Verify the detached signature
41+
- name: Verify the Detached Signature
42+
run: |
43+
name="test-file.txt"
44+
gpg --verify "${name}.asc" "${name}"
45+
46+
# Cleanup imported keys (optional, for security)
47+
- name: Cleanup GPG Keys
48+
run: gpg --batch --delete-secret-keys --yes $(gpg --list-secret-keys --with-colons | grep '^sec' | cut -d':' -f5)
49+
50+
# Run SVN Steps
51+
- name: Perform SVN Operations
52+
env:
53+
RC: rc1
54+
VERSION: 0.7.0rc1
55+
VERSION_WITHOUT_RC: 0.7.0
56+
VERSION_BRANCH: 0-7-0
57+
run: |
58+
export RC=rc1
59+
export VERSION=0.7.0${RC}
60+
export VERSION_WITHOUT_RC=${VERSION/rc?/}
61+
export VERSION_BRANCH=${VERSION_WITHOUT_RC//./-}
62+
63+
echo "RC: $RC"
64+
echo "VERSION: $VERSION"
65+
echo "VERSION_WITHOUT_RC: $VERSION_WITHOUT_RC"
66+
echo "VERSION_BRANCH: $VERSION_BRANCH"
67+
68+
export SVN_TMP_DIR=/tmp/iceberg-${VERSION_BRANCH}/
69+
svn checkout https://dist.apache.org/repos/dist/dev/iceberg $SVN_TMP_DIR
70+
71+
# export SVN_TMP_DIR_VERSIONED=${SVN_TMP_DIR}pyiceberg-$VERSION/
72+
# mkdir -p $SVN_TMP_DIR_VERSIONED
73+
# cp * $SVN_TMP_DIR_VERSIONED
74+
# svn add $SVN_TMP_DIR_VERSIONED
75+
# svn ci -m "PyIceberg ${VERSION}" ${SVN_TMP_DIR_VERSIONED}

0 commit comments

Comments
 (0)