Skip to content

Commit

Permalink
Merge pull request #7 from BeziCZ/main
Browse files Browse the repository at this point in the history
Fix actions to create release successfully
  • Loading branch information
RoyalKarma authored Apr 17, 2024
2 parents cc57edb + 16c3d4d commit e2f663b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build all template PDF and release it
# Feel free to increment this counter in your attempts to do things
# the smart way instead of the easy way.
#
# total_hours_wasted = 17
# total_hours_wasted = 19


on:
Expand All @@ -20,10 +20,10 @@ jobs:
# build šablony
build:
runs-on: ubuntu-latest

steps:
- name: Set up Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# kompilace
- name: Build ${{ matrix.dir }}
Expand All @@ -38,10 +38,10 @@ jobs:

# nahrání pro pozdější stažení
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
# název zip souboru se specifickým jménem předmětu
name: ${{ env.NAME }}
name: "FEKT.tex"
# co se má uložit do zip souboru
path: main.pdf

Expand All @@ -55,21 +55,21 @@ jobs:

steps:
- name: Set up Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Create tag
id: create_tag
run: |
tag=build-$(date +%Y%m%d-%H%M%S)
echo "::set-output name=tag::$tag"
echo "TAG=$tag" >> "$GITHUB_OUTPUT"
- name: Create Release
id: create_release
uses: actions/create-release@v1
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.tag }}
release_name: ${{ steps.create_tag.outputs.tag }}
tag_name: ${{ steps.create_tag.outputs.TAG }}
release_name: ${{ steps.create_tag.outputs.TAG }}
draft: false
prerelease: false

Expand All @@ -80,26 +80,28 @@ jobs:
needs: [ build, release ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set env
run: echo "NAME=$(grep -F "\newcommand{\subject}" main.tex | cut -d'{' -f 3 | cut -d'}' -f 1)" >> $GITHUB_ENV

# stažení dříve nahráneho zip souboru v subjects jobu
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: ${{ env.NAME }}
name: "FEKT.tex"

- name: Display structure of downloaded files
run: ls -R
# přidání do releasu
- name: Upload artifact to Release
uses: actions/upload-release-asset@v1
uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
# cesta k souboru
asset_path: ./main.pdf
# název v releasu
asset_name: ${{ env.NAME }}.pdf
asset_name: FEKTtex.pdf
asset_content_type: application/pdf

0 comments on commit e2f663b

Please sign in to comment.