From 174910c77ae35f9f27ed9babbe96d8e14e9422b3 Mon Sep 17 00:00:00 2001 From: Rishi Kumar Ray <87641376+RishiKumarRay@users.noreply.github.com> Date: Mon, 7 Feb 2022 13:59:59 +0530 Subject: [PATCH 1/6] Create main.yml --- .github/workflows/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..8ad38e5e40 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,13 @@ +name: Send a Tweet +on: [push] +jobs: + tweet: + runs-on: ubuntu-latest + steps: + - uses: ethomson/send-tweet-action@v1 + with: + status: "Hi, this is a test!" + consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} + access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} + access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} From 2115d20f8d5ece9618536dec153f535727b7b149 Mon Sep 17 00:00:00 2001 From: Rishi Kumar Ray <87641376+RishiKumarRay@users.noreply.github.com> Date: Mon, 7 Feb 2022 14:10:42 +0530 Subject: [PATCH 2/6] Update main.yml --- .github/workflows/main.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ad38e5e40..c117baec5d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,13 +1,22 @@ -name: Send a Tweet +name: tweet-release + +# Listen to the `release` event on: [push] + jobs: tweet: runs-on: ubuntu-latest steps: - - uses: ethomson/send-tweet-action@v1 + - uses: Eomm/why-don-t-you-tweet@v1 + # We don't want to tweet if the repository is not a public one + if: ${{ !github.event.repository.private }} with: - status: "Hi, this is a test!" - consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} - consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} - access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} - access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} + # GitHub event payload + # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release + tweet-message: "New ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}! Try it will it is HOT! ${{ github.event.release.html_url }} #nodejs #release" + env: + # Get your tokens from https://developer.twitter.com/apps + TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} + TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} + TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} From 135c9b18f7a7937bf0f8669e9e1a3daf7ecd0674 Mon Sep 17 00:00:00 2001 From: Rishi Kumar Ray <87641376+RishiKumarRay@users.noreply.github.com> Date: Mon, 7 Feb 2022 16:03:01 +0530 Subject: [PATCH 3/6] updated tweet.yml --- .github/workflows/{main.yml => tweet.yml} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename .github/workflows/{main.yml => tweet.yml} (91%) diff --git a/.github/workflows/main.yml b/.github/workflows/tweet.yml similarity index 91% rename from .github/workflows/main.yml rename to .github/workflows/tweet.yml index c117baec5d..e6a1fd71f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/tweet.yml @@ -1,7 +1,9 @@ name: tweet-release # Listen to the `release` event -on: [push] +on: + release: + types: [released] jobs: tweet: @@ -13,7 +15,7 @@ jobs: with: # GitHub event payload # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release - tweet-message: "New ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}! Try it will it is HOT! ${{ github.event.release.html_url }} #nodejs #release" + tweet-message: "New ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}! Try it will it is HOT! ${{ github.event.release.html_url }} #release" env: # Get your tokens from https://developer.twitter.com/apps TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} From 9064ab431fa8a6ed6a9bb6b74a92a7f61ef91e0c Mon Sep 17 00:00:00 2001 From: Rishi Kumar Ray <87641376+RishiKumarRay@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:21:43 +0530 Subject: [PATCH 4/6] added tweet to release --- .github/workflows/release.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b36caff8f1..2c0b87ada5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,3 +70,17 @@ jobs: if: ${{ startsWith(github.event.release.tag_name, 'v2.' ) }} with: github_token: ${{ secrets.GITHUB_TOKEN }} + - uses: Eomm/why-don-t-you-tweet@v1 + # We don't want to tweet if the repository is not a public one + if: ${{ !github.event.repository.private }} + with: + # GitHub event payload + # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release + tweet-message: "New ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}! Try it will it is HOT! ${{ github.event.release.html_url }} #release" + env: + # Get your tokens from https://developer.twitter.com/apps + TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} + TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} + TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} + From 839d6f33e71433e87151a36046a0581c866c59ab Mon Sep 17 00:00:00 2001 From: Rishi Kumar Ray <87641376+RishiKumarRay@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:22:04 +0530 Subject: [PATCH 5/6] Delete tweet.yml --- .github/workflows/tweet.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/tweet.yml diff --git a/.github/workflows/tweet.yml b/.github/workflows/tweet.yml deleted file mode 100644 index e6a1fd71f7..0000000000 --- a/.github/workflows/tweet.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: tweet-release - -# Listen to the `release` event -on: - release: - types: [released] - -jobs: - tweet: - runs-on: ubuntu-latest - steps: - - uses: Eomm/why-don-t-you-tweet@v1 - # We don't want to tweet if the repository is not a public one - if: ${{ !github.event.repository.private }} - with: - # GitHub event payload - # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release - tweet-message: "New ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}! Try it will it is HOT! ${{ github.event.release.html_url }} #release" - env: - # Get your tokens from https://developer.twitter.com/apps - TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} - TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} - TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} - TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} From 741e6283f60f874558f2cf6816ac81c4d46b7a23 Mon Sep 17 00:00:00 2001 From: Rishi Kumar Ray <87641376+RishiKumarRay@users.noreply.github.com> Date: Mon, 7 Feb 2022 18:09:05 +0530 Subject: [PATCH 6/6] added tweet --- .github/workflows/release.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c0b87ada5..d250e8610a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,21 @@ jobs: gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} nexus_username: ${{ secrets.OSSRH_USERNAME }} nexus_password: ${{ secrets.OSSRH_TOKEN }} + - uses: Eomm/why-don-t-you-tweet@v1 + # We don't want to tweet if the repository is not a public one + if: ${{ !github.event.repository.private }} + with: + # GitHub event payload + # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release + tweet-message: "New ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}! Try it will it is HOT! ${{ github.event.release.html_url }} #release" + env: + # Get your tokens from https://developer.twitter.com/apps + TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} + TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} + TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} + + # This is separate job because there were issues with git after release step, was not able to commit changes. See history. update-working-version: @@ -70,17 +85,3 @@ jobs: if: ${{ startsWith(github.event.release.tag_name, 'v2.' ) }} with: github_token: ${{ secrets.GITHUB_TOKEN }} - - uses: Eomm/why-don-t-you-tweet@v1 - # We don't want to tweet if the repository is not a public one - if: ${{ !github.event.repository.private }} - with: - # GitHub event payload - # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release - tweet-message: "New ${{ github.event.repository.name }} release ${{ github.event.release.tag_name }}! Try it will it is HOT! ${{ github.event.release.html_url }} #release" - env: - # Get your tokens from https://developer.twitter.com/apps - TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} - TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} - TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} - TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} -