Skip to content

Commit

Permalink
Deploy tagged commits
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledhosny committed Oct 5, 2022
1 parent 76db7d9 commit 2a2a7cf
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -9,7 +9,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Fetch
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow --tags --force
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -20,4 +23,41 @@ jobs:
python -m pip install -r requirements.txt
- name: Build
run: |
make
make -j -B dist
- name: Upload artifacts
if: github.ref_type == 'tag'
uses: actions/upload-artifact@v2
with:
name: dist
path: Amiri-*.zip
if-no-files-found: error

deploy:
if: github.ref_type == 'tag'
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: dist

- name: Extract release notes from annotated tag message
run: |
# GH checkout action doesn't preserve tag annotations, we must fetch them
# https://github.com/actions/checkout/issues/290
git fetch --tags --force
echo "$(git tag -l --format='%(contents:body)' ${{ github.ref_name }})" > "${{ runner.temp }}/release_body.md"
echo "release_name=$(git tag -l --format='%(contents:subject)' ${{ github.ref_name }})" >> $GITHUB_ENV
- name: Publish
uses: softprops/action-gh-release@v1
with:
name: ${{ env.release_name }}
body_path: ${{ runner.temp }}/release_body.md
fail_on_unmatched_files: true
files: |
dist/*/*

0 comments on commit 2a2a7cf

Please sign in to comment.