Skip to content

Commit

Permalink
chore: revert test
Browse files Browse the repository at this point in the history
  • Loading branch information
behnam-deriv committed Mar 29, 2024
1 parent 8cb1ffa commit b20696e
Showing 1 changed file with 56 additions and 57 deletions.
113 changes: 56 additions & 57 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: version

on:
workflow_dispatch:
pull_request:
types:
- closed
Expand All @@ -11,11 +10,11 @@ on:
jobs:
version_and_tag:
runs-on: ubuntu-latest
# if: >
# github.event.pull_request.merged == true &&
# !startsWith(github.event.pull_request.title, 'chore') &&
# !startsWith(github.event.pull_request.title, 'ci') &&
# !startsWith(github.event.pull_request.title, 'add')
if: >
github.event.pull_request.merged == true &&
!startsWith(github.event.pull_request.title, 'chore') &&
!startsWith(github.event.pull_request.title, 'ci') &&
!startsWith(github.event.pull_request.title, 'add')
steps:
- name: Git Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand All @@ -26,69 +25,69 @@ jobs:
- name: Setup Git User
uses: fregante/setup-git-user@77c1b5542f14ab6db4b8462d6857e31deb988b09

# - name: Setup Flutter
# uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
# with:
# channel: "stable"
# flutter-version: "3.10.2"
# cache: true
- name: Setup Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
channel: "stable"
flutter-version: "3.10.2"
cache: true

# - name: Setup Melos
# uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
# with:
# melos-version: "3.2.0"
# run-bootstrap: false
- name: Setup Melos
uses: bluefireteam/melos-action@dd3c344d731938d2ab2567a261f54a19a68b5f6a
with:
melos-version: "3.2.0"
run-bootstrap: false

# - name: Create git tag based on version
# run: melos version --all --yes
- name: Create git tag based on version
run: melos version --all --yes

# - name: Get new tags
# id: new-tags
# run: |
# local_tags=$(git tag)
# remote_tags=$(git ls-remote --tags origin | cut -d/ -f3)
# new_tags=$(comm -23 <(sort <<<"$local_tags") <(sort <<<"$remote_tags"))
- name: Get new tags
id: new-tags
run: |
local_tags=$(git tag)
remote_tags=$(git ls-remote --tags origin | cut -d/ -f3)
new_tags=$(comm -23 <(sort <<<"$local_tags") <(sort <<<"$remote_tags"))
# # Format new tags into a single line with '\n' between tags
# formatted_tags=$(echo -e "$new_tags" | tr '\n' ' ')
# Format new tags into a single line with '\n' between tags
formatted_tags=$(echo -e "$new_tags" | tr '\n' ' ')
# # Append the formatted tags to the file
# echo -e "NEW_TAGS=$formatted_tags" >> "$GITHUB_OUTPUT"
# shell: bash
# Append the formatted tags to the file
echo -e "NEW_TAGS=$formatted_tags" >> "$GITHUB_OUTPUT"
shell: bash

# - name: Push tag
# id: push-tag
# run: |
# output=$(git push --tags 2>&1)
- name: Push tag
id: push-tag
run: |
output=$(git push --tags 2>&1)
# if [[ $output == *"Everything up-to-date"* ]]; then
# echo "PUSH_OUTPUT=No package updated" >> $GITHUB_OUTPUT
# else
# echo "PUSH_OUTPUT=Packages updated" >> $GITHUB_OUTPUT
# fi
# shell: bash
if [[ $output == *"Everything up-to-date"* ]]; then
echo "PUSH_OUTPUT=No package updated" >> $GITHUB_OUTPUT
else
echo "PUSH_OUTPUT=Packages updated" >> $GITHUB_OUTPUT
fi
shell: bash

# - name: Make the script files executable
# if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
# run: chmod +x readme.sh
# working-directory: ./scripts
- name: Make the script files executable
if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
run: chmod +x readme.sh
working-directory: ./scripts

# - name: Update README.md
# if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
# run: bash readme.sh
# working-directory: ./scripts
- name: Update README.md
if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
run: bash readme.sh
working-directory: ./scripts

# - name: Create Pull Request on updated changelog and pubspec file.
# uses: peter-evans/create-pull-request@76c6f5c20e2111bfee3cd30fae52a25e410f5efc
# with:
# token: ${{ secrets.PAT }}
# title: "chore(version): bump version and update changelog"
# base: master
- name: Create Pull Request on updated changelog and pubspec file.
uses: peter-evans/create-pull-request@76c6f5c20e2111bfee3cd30fae52a25e410f5efc
with:
token: ${{ secrets.PAT }}
title: "chore(version): bump version and update changelog"
base: master

- name: Send Slack Notification
uses: ./.github/actions/send_slack_notifications
# if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
with:
SLACK_WEBHOOK_PACKAGE_UPDATE: ${{ secrets.SLACK_WEBHOOK_PACKAGE_UPDATE }}
PR_TITLE: "Test PR Title"
TAGS: "Test Tags"
PR_TITLE: ${{ github.event.pull_request.title }}
TAGS: ${{ steps.new-tags.outputs.NEW_TAGS }}

0 comments on commit b20696e

Please sign in to comment.