generated from graasp/graasp-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: upgrade workflow versions (#191)
- Loading branch information
Showing
5 changed files
with
23 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,33 +4,30 @@ name: Release new app version | |
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- "main" | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
- uses: google-github-actions/release-please-action@v4 | ||
id: release | ||
with: | ||
release-type: node | ||
# TODO: replace this with your app name | ||
package-name: graasp-app-quiz | ||
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"docs","section":"Documentation","hidden":false},{"type":"test","section":"Tests","hidden":false}]' | ||
|
||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
# creates minor and major tags that follow the latest release | ||
- name: Tag major and minor versions | ||
uses: jacobsvante/[email protected] | ||
if: ${{ steps.release.outputs.release_created }} | ||
if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
with: | ||
major: ${{ steps.release.outputs.major }} | ||
minor: ${{ steps.release.outputs.minor }} | ||
|
||
# put created tag in an env variable to be sent to the dispatch | ||
- name: Set tag | ||
if: ${{ steps.release.outputs.release_created }} | ||
if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
id: set-tag | ||
run: | | ||
REPOSITORY=$(echo '${{ github.repository }}') | ||
|
@@ -40,35 +37,16 @@ jobs: | |
# Trigger an 'on: repository_dispatch' workflow to run in graasp-deploy repository | ||
- name: Push tag to Graasp Deploy (Staging) | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: peter-evans/repository-dispatch@v2 | ||
if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
uses: peter-evans/repository-dispatch@v3 | ||
with: | ||
token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
repository: graasp/graasp-deploy | ||
event-type: update-staging-version | ||
client-payload: ${{ steps.set-tag.outputs.json }} | ||
client-payload: ${{steps.set-tag.outputs.json}} | ||
|
||
- name: Auto Tag | ||
id: auto-tag | ||
if: ${{ steps.release.outputs.releases_created }} | ||
run: | | ||
gh label create ${{ env.TAG_NAME }} -f --color 0E8A16 --repo ${{ env.REPO }}; | ||
echo '### `${{ env.TAG_NAME }}` :rocket:' >> $GITHUB_STEP_SUMMARY; | ||
echo 'Tag all ${{ env.PRE_LABEL_NAME }} issues and prs as ${{ env.TAG_NAME }}'; | ||
for cmd in issue pr; | ||
do | ||
for nbr in $(gh $cmd list -l ${{ env.PRE_LABEL_NAME }} -s all --json number --jq '.[].number' --repo ${{ env.REPO }} ); | ||
do | ||
URL=$(gh $cmd edit $nbr --add-label ${{ env.TAG_NAME }} --remove-label ${{ env.PRE_LABEL_NAME }} --repo ${{ env.REPO }} ); | ||
echo "- $cmd #$nbr $URL" >> $GITHUB_STEP_SUMMARY; | ||
done | ||
done | ||
echo '' >> $GITHUB_STEP_SUMMARY; | ||
echo ':rocket: All related issues and prs tagged !' >> $GITHUB_STEP_SUMMARY; | ||
echo ':scroll: Check out [the created release](${{ env.RELEASE_URL }}) !' >> $GITHUB_STEP_SUMMARY; | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
TAG_NAME: ${{ steps.release.outputs.tag_name }} | ||
PRE_LABEL_NAME: un-released | ||
REPO: ${{ github.event.repository.full_name }} | ||
RELEASE_URL: ${{ github.event.repository.html_url }}/releases/tag/${{ steps.release.outputs.tag_name }} | ||
uses: graasp/graasp-deploy/.github/actions/auto-tag-after-release@v1 | ||
with: | ||
releases_created: ${{ steps.release.outputs.releases_created }} | ||
tag_name: ${{ steps.release.outputs.tag_name }} |