9
9
jobs :
10
10
release :
11
11
runs-on : ubuntu-latest
12
-
13
12
steps :
14
13
- 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
16
23
17
24
- name : Build with SAM
18
25
run : sam build --use-container
19
26
20
27
- name : Zip the contents
28
+ id : zip
21
29
run : |
22
30
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
24
35
25
- - name : Get changelog
36
+ - name : Generate changelog
26
37
id : changelog
27
38
run : |
28
39
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
31
46
echo "changelog<<EOF" >> $GITHUB_ENV
32
47
echo "$changelog" >> $GITHUB_ENV
33
48
echo "EOF" >> $GITHUB_ENV
34
49
35
50
- name : Create Release
36
51
id : create_release
37
- uses : ncipollo/release-action@v1
52
+ uses : actions/create-release@v1
53
+ env :
54
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38
55
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 }}
41
58
body : ${{ env.changelog }}
42
59
draft : false
43
60
prerelease : false
44
61
45
62
- 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 }}
47
66
with :
48
67
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