Skip to content

Commit 52dd48c

Browse files
committed
use env action
1 parent 4030efe commit 52dd48c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/macos-release.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,30 @@ jobs:
1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v3
16+
- name: Read Tag Version
17+
run: |
18+
v=`echo $(git describe --tags) | awk -F . '{printf "%s.%d",$1,$2+1}'`
19+
echo "RELEASE_VERSION="$v" > constants.env
20+
- uses: cardinalby/export-env-action@v2
21+
with:
22+
envFile: 'constants.env'
1623
- name: do compile libs
1724
run: |
1825
./init-any.sh macos libyuv
1926
cd macos
2027
./compile-any.sh build libyuv
2128
./compile-any.sh lipo libyuv
2229
cd ../build/product/macos/universal
30+
# github action must be use " . -i "
2331
zip -rq macos-universal.zip . -i ./universal/*
24-
v=`echo $(git describe --tags) | awk -F . '{printf "%s.%d",$1,$2+1}'`
25-
export RELEASE_VERSION="$v"
2632
- name: Create Release
2733
id: create_release
2834
uses: actions/create-release@v1
2935
env:
3036
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3137
with:
32-
tag_name: ${{ RELEASE_VERSION }}
33-
release_name: Release ${{ RELEASE_VERSION }}
38+
tag_name: ${{ env.RELEASE_VERSION }}
39+
release_name: Release ${{ env.RELEASE_VERSION }}
3440
draft: false
3541
prerelease: false
3642
- name: Upload Release Asset
@@ -41,5 +47,5 @@ jobs:
4147
with:
4248
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
4349
asset_path: build/product/macos/universal/macos-universal.zip
44-
asset_name: "macos-universal-${{ RELEASE_VERSION }}.zip"
50+
asset_name: "macos-universal-${{ env.RELEASE_VERSION }}.zip"
4551
asset_content_type: application/zip

0 commit comments

Comments
 (0)