Skip to content

Commit

Permalink
Publish policies separately
Browse files Browse the repository at this point in the history
  • Loading branch information
xiwenc committed Mar 31, 2024
1 parent ce9ffa2 commit 4bb80c5
Showing 1 changed file with 66 additions and 2 deletions.
68 changes: 66 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release binaries
name: Release

on:
release:
Expand All @@ -25,4 +25,68 @@ jobs:
project_path: "./cmd/mendix-cli"
binary_name: "mendix-cli"
ldflags: "-s -w"
compress_assets: OFF
compress_assets: OFF
policies-zip-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Zip policies directory
run: zip -r policies.zip policies/

- name: Use the same release for the tar.gz asset
id: get_release
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { data: release } = await github.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', '')
})
return release
- name: Upload Release Asset (ZIP)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./policies.zip
asset_name: policies.zip
asset_content_type: application/zip

policies-tar-gz-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Create Tar.gz policies directory
run: tar -czvf policies.tar.gz policies/

- name: Use the same release for the tar.gz asset
id: get_release
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { data: release } = await github.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', '')
})
return release
- name: Upload Release Asset (tar.gz)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./policies.tar.gz
asset_name: policies.tar.gz
asset_content_type: application/gzip

0 comments on commit 4bb80c5

Please sign in to comment.