-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update github actions (20230710)
- Loading branch information
1 parent
715e088
commit 624ebd0
Showing
3 changed files
with
57 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,74 +8,50 @@ on: | |
jobs: | ||
create-releases: | ||
name: create-releases | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | ||
- name: check package.json version | ||
env: | ||
version: ${{ steps.get_version.outputs.VERSION }} | ||
run: node ./tools/checker.js version ${version} | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
name: Release ${{ steps.get_version.outputs.VERSION }} | ||
body: | | ||
Changes in this Release | ||
- First Change | ||
- Second Change | ||
draft: false | ||
prerelease: true | ||
continue-on-error: true | ||
- name: Get release | ||
if: steps.create_release.outcome == 'failure' | ||
id: get_release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: output url | ||
id: output_url | ||
- name: Get the asset name | ||
id: asset_name | ||
run: | | ||
echo "::set-output name=upload_url::${{steps.get_release.outputs.upload_url}}${{steps.create_release.outputs.upload_url}}" | ||
echo "TAR_NAME=cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.tar" >> $GITHUB_OUTPUT | ||
echo "ZIP_NAME=cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.zip" >> $GITHUB_OUTPUT | ||
- name: create archive file | ||
env: | ||
TAR_NAME: cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.tar | ||
run: | | ||
mkdir work | ||
cp -rp dist/* work | ||
cp cfdjs_wasm_jsonapi.js work | ||
cd work | ||
zip -r ../cfd.zip . | ||
tar -cvf ../$TAR_NAME * | ||
zip -r ../${{ steps.asset_name.outputs.ZIP_NAME }} . | ||
tar -cvf ../${{ steps.asset_name.outputs.TAR_NAME }} * | ||
cd .. | ||
gzip $TAR_NAME | ||
gzip ${{ steps.asset_name.outputs.TAR_NAME }} | ||
echo "---- dump file ----" | ||
ls -l | ||
- name: Upload Release Asset by zip | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
upload_url: ${{ steps.output_url.outputs.upload_url }} | ||
asset_path: ./cfd.zip | ||
asset_name: cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.zip | ||
asset_content_type: application/zip | ||
- name: Upload Release Asset by tgz | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAR_NAME: cfdwasm-${{ steps.get_version.outputs.VERSION }}-0.tar | ||
with: | ||
upload_url: ${{ steps.output_url.outputs.upload_url }} | ||
asset_path: ./${{ env.TAR_NAME }}.gz | ||
asset_name: ${{ env.TAR_NAME }}.gz | ||
asset_content_type: application/gzip | ||
|
||
files: | | ||
${{ steps.asset_name.outputs.TAR_NAME }}.gz | ||
${{ steps.asset_name.outputs.ZIP_NAME }} |