From e8f70a81ef14ab309f32a836a92718a75f1a77b8 Mon Sep 17 00:00:00 2001 From: Nikolai Kudasov Date: Wed, 12 Jul 2023 08:25:44 +0300 Subject: [PATCH] Add missing permissions to workflow binaries.yml --- .github/workflows/binaries.yml | 91 ++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index dbe190636..fe62bfea1 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -5,6 +5,9 @@ on: release: types: [published] +permissions: + contents: write + jobs: build: runs-on: ${{ matrix.os }} @@ -13,53 +16,53 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Cache Stack files - uses: actions/cache@v3 - env: - cache-name: cache-tools-and-libraries - with: - path: ~/.stack - key: ${{ runner.os }}-ca-${{ env.cache-name }}-${{ hashFiles('**/stack.yaml.lock') }} - restore-keys: | - ${{ runner.os }}-ca-${{ env.cache-name }}- - ${{ runner.os }}-ca- - ${{ runner.os }}- + - name: Cache Stack files + uses: actions/cache@v3 + env: + cache-name: cache-tools-and-libraries + with: + path: ~/.stack + key: ${{ runner.os }}-ca-${{ env.cache-name }}-${{ hashFiles('**/stack.yaml.lock') }} + restore-keys: | + ${{ runner.os }}-ca-${{ env.cache-name }}- + ${{ runner.os }}-ca- + ${{ runner.os }}- -# - name: 🔨 Install BNFC, alex and happy (with Stack) -# run: | -# stack install alex happy BNFC -# -# - name: 🔨 Generate Syntax files using BNFC -# run: | -# cd rzk/ && (make && make clean; cd ../) + # - name: 🔨 Install BNFC, alex and happy (with Stack) + # run: | + # stack install alex happy BNFC + # + # - name: 🔨 Generate Syntax files using BNFC + # run: | + # cd rzk/ && (make && make clean; cd ../) - - name: 🔨 Remove rzk.cabal, lexer and parser generator files - run: | - rm rzk/src/Language/Rzk/Syntax/Lex.x - rm rzk/src/Language/Rzk/Syntax/Par.y - rm rzk/rzk.cabal + - name: 🔨 Remove rzk.cabal, lexer and parser generator files + run: | + rm rzk/src/Language/Rzk/Syntax/Lex.x + rm rzk/src/Language/Rzk/Syntax/Par.y + rm rzk/rzk.cabal - - name: 🔨 Build the project - run: stack build + - name: 🔨 Build the project + run: stack build - - name: Tar and strip the binary - run: | - mkdir -p prepared_binaries/ - cd prepared_binaries/ - export PROGRAM=rzk - cp `stack exec -- which $PROGRAM` . - tar -cavf program.tar.gz * - shell: bash + - name: Tar and strip the binary + run: | + mkdir -p prepared_binaries/ + cd prepared_binaries/ + export PROGRAM=rzk + cp `stack exec -- which $PROGRAM` . + tar -cavf program.tar.gz * + shell: bash - - name: 🚀 Upload assets - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./prepared_binaries/program.tar.gz - asset_name: rzk-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.tar.gz - asset_content_type: application/tar.gz + - name: 🚀 Upload assets + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./prepared_binaries/program.tar.gz + asset_name: rzk-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.tar.gz + asset_content_type: application/tar.gz