Skip to content

Commit 5340fbc

Browse files
authored
Update build_app.yaml
1 parent 85f48e7 commit 5340fbc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/build_app.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ env:
1010
jobs:
1111
release:
1212
runs-on: ubuntu-latest
13+
outputs:
14+
output: ${{ steps.get_latest_release.outputs.updated }}
1315
steps:
1416
- name: Get latest release
17+
id: get_latest_release
1518
run: |
16-
echo "updated=true" >> $GITHUB_ENV
19+
echo "updated=true" >> "$GITHUB_OUTPUT"
1720
if [[ "${{ github.ref_name }}" == "$(curl -s -u ${{ secrets.LIBRESCORE_USERNAME }}:${{ secrets.LIBRESCORE_TOKEN }} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/LibreScore/${{ secrets.LIBRESCORE_REPO_A }}/releases/latest | jq --raw-output ".tag_name")" ]]; then
18-
echo "updated=false" >> $GITHUB_ENV
21+
echo "updated=false" >> "$GITHUB_OUTPUT"
1922
exit 1
2023
fi
2124
- name: Publish pre-release
22-
if: env.updated == 'true'
25+
if: ${{ steps.get_latest_release.outputs.updated }} == 'true'
2326
uses: softprops/action-gh-release@v1
2427
with:
2528
token: ${{ secrets.LIBRESCORE_TOKEN }}
@@ -235,7 +238,7 @@ Installation instructions are in the [README](https://github.com/LibreScore/${{
235238
runs-on: ubuntu-latest
236239
steps:
237240
- name: Delete pre-release
238-
if: env.updated == 'true'
241+
if: ${{needs.release.outputs.updated}} == 'true'
239242
run: |
240243
ID_A="$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.LIBRESCORE_TOKEN }}" https://api.github.com/repos/LibreScore/${{ secrets.LIBRESCORE_REPO_A }}/releases/tags/${{ github.ref_name }} | jq -r .id)"
241244
curl -s -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.LIBRESCORE_TOKEN }}" https://api.github.com/repos/LibreScore/${{ secrets.LIBRESCORE_REPO_A }}/releases/$ID_A
@@ -244,6 +247,6 @@ Installation instructions are in the [README](https://github.com/LibreScore/${{
244247
curl -s -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.LIBRESCORE_TOKEN }}" https://api.github.com/repos/LibreScore/${{ secrets.LIBRESCORE_REPO_B }}/releases/$ID_B
245248
curl -s -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.LIBRESCORE_TOKEN }}" https://api.github.com/repos/LibreScore/${{ secrets.LIBRESCORE_REPO_B }}/git/refs/tags/${{ github.ref_name }}
246249
- name: Delete workflow run
247-
if: env.updated == 'false'
250+
if: ${{needs.release.outputs.updated}} == 'false'
248251
run: |
249252
curl -s -i -u ${{ secrets.LIBRESCORE_USERNAME }}:${{ secrets.LIBRESCORE_TOKEN }} -d '{"event_type":"delete_action","client_payload":{"run_id":"'"${{ github.run_id }}"'","repo":"LibreScore/app-librescore"}}' -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/LibreScore/actions/dispatches

0 commit comments

Comments
 (0)