Skip to content

Commit 2e7058c

Browse files
committed
Use only official upstream actions
1 parent 8833993 commit 2e7058c

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,62 @@ on:
99
jobs:
1010
release:
1111
runs-on: ubuntu-latest
12-
1312
steps:
1413
- name: Checkout code
15-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install AWS SAM CLI
22+
run: pip install aws-sam-cli
1623

1724
- name: Build with SAM
1825
run: sam build --use-container
1926

2027
- name: Zip the contents
28+
id: zip
2129
run: |
2230
commit_hash=$(git rev-parse --short HEAD)
23-
zip -r apache-iceberg-monitoring-$commit_hash.zip .aws-sam/build/IcebergMetricsLambda/
31+
zip_name="apache-iceberg-monitoring-${commit_hash}.zip"
32+
cd .aws-sam/build/IcebergMetricsLambda
33+
zip -r "../../../${zip_name}" .
34+
echo "zip_name=${zip_name}" >> $GITHUB_OUTPUT
2435
25-
- name: Get changelog
36+
- name: Generate changelog
2637
id: changelog
2738
run: |
2839
git fetch --prune --unshallow
29-
previous_release=$(git tag --sort=-creatordate | head -n 1)
30-
changelog=$(git log $previous_release..HEAD --pretty=format:'* %s')
40+
previous_tag=$(git tag --sort=-creatordate | tail -n 1)
41+
if [ -z "$previous_tag" ]; then
42+
changelog=$(git log --pretty=format:"* %s")
43+
else
44+
changelog=$(git log $previous_tag..HEAD --pretty=format:"* %s")
45+
fi
3146
echo "changelog<<EOF" >> $GITHUB_ENV
3247
echo "$changelog" >> $GITHUB_ENV
3348
echo "EOF" >> $GITHUB_ENV
3449
3550
- name: Create Release
3651
id: create_release
37-
uses: ncipollo/release-action@v1
52+
uses: actions/create-release@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3855
with:
39-
tag: "apache-iceberg-monitoring-${{ github.sha }}"
40-
name: "apache-iceberg-monitoring-${{ github.sha }}"
56+
tag_name: apache-iceberg-monitoring-${{ github.sha }}
57+
release_name: apache-iceberg-monitoring-${{ github.sha }}
4158
body: ${{ env.changelog }}
4259
draft: false
4360
prerelease: false
4461

4562
- name: Upload Release Asset
46-
uses: ncipollo/upload-release-asset@v1
63+
uses: actions/upload-release-asset@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4766
with:
4867
upload_url: ${{ steps.create_release.outputs.upload_url }}
49-
asset: apache-iceberg-monitoring-${{ github.sha }}.zip
68+
asset_path: ./${{ steps.zip.outputs.zip_name }}
69+
asset_name: ${{ steps.zip.outputs.zip_name }}
70+
asset_content_type: application/zip

0 commit comments

Comments
 (0)