Workflow file for this run
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
name: Create Release Zip and SHA-256 | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the code | |
if: ${{ github.event.release.prerelease == false }} | |
uses: actions/checkout@v4 | |
with: | |
ref: 'public' | |
- name: Check out the code (beta) | |
if: ${{ github.event.release.prerelease == true }} | |
uses: actions/checkout@v4 | |
with: | |
ref: 'beta' | |
- name: Zip specific files and folders | |
run: | | |
zip -r BeamMP.zip icons lua mp_locales scripts settings ui vehicles CONTRIBUTING.md CODE_OF_CONDUCT.md LICENSE.md README.md NOTICES.md | |
working-directory: ${{ github.workspace }} | |
- name: Generate SHA-256 hash | |
id: sha256 | |
run: | | |
sha256sum BeamMP.zip | awk '{print $1}' > BeamMP.zip.sha256 | |
working-directory: ${{ github.workspace }} | |
- name: Upload artifacts | |
run: | | |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Content-Type: application/zip" \ | |
--data-binary "@BeamMP.zip" \ | |
--url "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=BeamMP.zip" | |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Content-Type: text/plain" \ | |
--data-binary "@BeamMP.zip.sha256" \ | |
--url "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=BeamMP.zip.sha256" | |
working-directory: ${{ github.workspace }} |