Skip to content

Commit

Permalink
Improve GH action to produce release artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Aug 19, 2024
1 parent 08800b5 commit b4d7f3b
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,26 @@ jobs:
hashes: ${{ steps.hash.outputs.hashes }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build artifacts
run: |
git archive -o kokkos-kernels-${{ github.ref_name }}.zip HEAD
git archive -o kokkos-kernels-${{ github.ref_name }}.tar.gz HEAD
git archive --prefix=kokkos-kernels-${{ github.ref_name }}/ -o kokkos-kernels-${{ github.ref_name }}.zip HEAD
git archive --prefix=kokkos-kernels-${{ github.ref_name }}/ -o kokkos-kernels-${{ github.ref_name }}.tar.gz HEAD
- name: Generate hashes
shell: bash
id: hash
run: |
# sha256sum generates sha256 hash for all artifacts.
# base64 -w0 encodes to base64 and outputs on a single line.
echo "hashes=$(sha256sum kokkos-kernels-${{ github.ref_name }}.zip kokkos-kernels-${{ github.ref_name }}.tar.gz | base64 -w0)" >> "$GITHUB_OUTPUT"
sha256sum kokkos-kernels-${{ github.ref_name }}.zip kokkos-kernels-${{ github.ref_name }}.tar.gz > kokkos-kernels-${{ github.ref_name }}-SHA-256.txt
echo "hashes=$(base64 -w0 kokkos-kernels-${{ github.ref_name }}-SHA-256.txt)" >> "$GITHUB_OUTPUT"
- name: Upload source code (zip)
- name: Upload artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: kokkos-kernels-${{ github.ref_name }}.zip
path: kokkos-kernels-${{ github.ref_name }}.zip
if-no-files-found: error
retention-days: 5

- name: Upload source code (tar.gz)
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: kokkos-kernels-${{ github.ref_name }}.tar.gz
path: kokkos-kernels-${{ github.ref_name }}.tar.gz
name: release-artifacts
path: kokkos-kernels-${{ github.ref_name }}*
if-no-files-found: error
retention-days: 5

Expand All @@ -65,19 +58,14 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download kokkos-kernels-${{ github.ref_name }}.zip
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: kokkos-kernels-${{ github.ref_name }}.zip

- name: Download kokkos-kernels-${{ github.ref_name }}.tar.gz
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: kokkos-kernels-${{ github.ref_name }}.tar.gz

name: release-artifacts
- name: Upload assets
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
files: |
kokkos-kernels-${{ github.ref_name }}.zip
kokkos-kernels-${{ github.ref_name }}.tar.gz
kokkos-kernels-${{ github.ref_name }}-SHA-256.txt

0 comments on commit b4d7f3b

Please sign in to comment.