Skip to content

Commit

Permalink
Add missing permissions to workflow binaries.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fizruk committed Jul 12, 2023
1 parent 51b7584 commit e8f70a8
Showing 1 changed file with 47 additions and 44 deletions.
91 changes: 47 additions & 44 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
release:
types: [published]

permissions:
contents: write

jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -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

0 comments on commit e8f70a8

Please sign in to comment.