Skip to content

Commit

Permalink
Add new action release-asset-creator
Browse files Browse the repository at this point in the history
  • Loading branch information
jatu-studiobox authored Mar 11, 2022
1 parent 1668a68 commit 634ef5f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/03-release-asset-creator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release-asset-creator
on:
release:
types: [published]
jobs:
my-job:
runs-on: ubuntu-latest
env:
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
steps:
- name: download-source
run: curl -sL "${{ github.event.release.tarball_url }}" >"$ARCHIVE_NAME".tar.gz
- name: unzip-source
run: mkdir "$ARCHIVE_NAME" && tar -xzf "$ARCHIVE_NAME".tar.gz -C "$ARCHIVE_NAME" --strip-components 1
- name: clean-source
run: rm -rf "$ARCHIVE_NAME"/.github
- name: create-archive
run: tar -czf "$ARCHIVE_NAME".tar.gz "$ARCHIVE_NAME"
- name: create-checksum
run: sha256sum "$ARCHIVE_NAME".tar.gz >checksum.txt
- name: upload-archive
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARCHIVE_NAME }}.tar.gz
asset_name: ${{ env.ARCHIVE_NAME }}.tar.gz
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: upload-checksum
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: checksum.txt
asset_name: checksum.txt
asset_content_type: text/plain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 634ef5f

Please sign in to comment.