diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 8e3d329..996f1a7 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,26 +1,27 @@ ο»Ώname: changelog on: + workflow_dispatch: release: types: [released] - workflow_dispatch: jobs: changelog: runs-on: ubuntu-latest steps: + - name: πŸ€– defaults + uses: devlooped/actions-bot@v1 + with: + name: ${{ secrets.BOT_NAME }} + email: ${{ secrets.BOT_EMAIL }} + gh_token: ${{ secrets.GH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: 🀘 checkout uses: actions/checkout@v2 with: fetch-depth: 0 ref: main - - - name: πŸ” defaults - uses: ./.github/workflows/defaults - env: - GH_TOKEN_SECRET: ${{ secrets.GH_TOKEN }} - BOT_NAME_SECRET: ${{ secrets.BOT_NAME }} - BOT_EMAIL_SECRET: ${{ secrets.BOT_EMAIL }} - BOT_AUTHOR_SECRET: ${{ secrets.BOT_AUTHOR }} + token: ${{ env.GH_TOKEN }} - name: βš™ ruby uses: ruby/setup-ruby@v1 @@ -30,11 +31,9 @@ jobs: - name: βš™ changelog run: | gem install github_changelog_generator - github_changelog_generator --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md --config-file .github/.github_changelog_generator + github_changelog_generator --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token $GH_TOKEN --o changelog.md --config-file .github/.github_changelog_generator - name: πŸš€ changelog run: | - git config --local user.name $BOT_NAME - git config --local user.email $BOT_EMAIL git add changelog.md - (git commit -m "πŸ–‰ Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done" + (git commit -m "πŸ–‰ Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done" \ No newline at end of file diff --git a/.github/workflows/defaults/action.yml b/.github/workflows/defaults/action.yml deleted file mode 100644 index 65bad05..0000000 --- a/.github/workflows/defaults/action.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: test -description: runs dotnet tests with retry -runs: - using: "composite" - steps: - - name: πŸ” GH_TOKEN - if: env.GH_TOKEN == '' - shell: bash - run: | - if [ -z "$GH_TOKEN_SECRET" ] - then - echo "Using default GITHUB_TOKEN" - echo "GH_TOKEN=$GITHUB_TOKEN" >> $GITHUB_ENV - else - echo "Using custom GH_TOKEN" - echo "GH_TOKEN=$GH_TOKEN_SECRET" >> $GITHUB_ENV - fi - - - name: πŸ” BOT - shell: bash - run: | - if [ -z "$BOT_NAME"] - then - if [ -z "$BOT_NAME_SECRET" ] - then - echo "Using default GITHUB_ACTOR as BOT_NAME" - BOT_NAME="$GITHUB_ACTOR" - else - echo "Using custom BOT_NAME" - BOT_NAME=$BOT_NAME_SECRET - fi - echo "BOT_NAME=$BOT_NAME" >> $GITHUB_ENV - fi - - if [ -z "$BOT_EMAIL"] - then - if [ -z "$BOT_EMAIL_SECRET" ] - then - echo "Using default GITHUB_EMAIL as BOT_EMAIL" - BOT_EMAIL="$GITHUB_ACTOR@users.noreply.github.com" - else - echo "Using custom BOT_EMAIL" - BOT_EMAIL="$BOT_EMAIL_SECRET" - fi - echo "BOT_EMAIL=$BOT_EMAIL" >> $GITHUB_ENV - fi - - if [ -z "$BOT_AUTHOR"] - then - if [ -z "$BOT_AUTHOR_SECRET" ] - then - echo "Using default BOT_NAME as BOT_AUTHOR" - BOT_AUTHOR="$BOT_NAME <$BOT_EMAIL>" - else - echo "Using custom BOT_AUTHOR" - BOT_AUTHOR="$BOT_AUTHOR_SECRET" - fi - echo "BOT_AUTHOR=$BOT_AUTHOR" >> $GITHUB_ENV - fi diff --git a/.github/workflows/dotnet-file.yml b/.github/workflows/dotnet-file.yml index 26a81e9..fc991c4 100644 --- a/.github/workflows/dotnet-file.yml +++ b/.github/workflows/dotnet-file.yml @@ -14,19 +14,20 @@ jobs: sync: runs-on: windows-latest steps: + - name: πŸ€– defaults + uses: devlooped/actions-bot@v1 + with: + name: ${{ secrets.BOT_NAME }} + email: ${{ secrets.BOT_EMAIL }} + gh_token: ${{ secrets.GH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: 🀘 checkout uses: actions/checkout@v2 with: fetch-depth: 0 ref: main - - - name: πŸ” defaults - uses: ./.github/workflows/defaults - env: - GH_TOKEN_SECRET: ${{ secrets.GH_TOKEN }} - BOT_NAME_SECRET: ${{ secrets.BOT_NAME }} - BOT_EMAIL_SECRET: ${{ secrets.BOT_EMAIL }} - BOT_AUTHOR_SECRET: ${{ secrets.BOT_AUTHOR }} + token: ${{ env.GH_TOKEN }} - name: βŒ› rate shell: pwsh @@ -62,6 +63,11 @@ jobs: echo 'No changelog was generated' } + - name: +Mᐁ includes + uses: devlooped/actions-include@v1 + with: + validate: false + - name: ✍ pull request uses: peter-evans/create-pull-request@v3 with: @@ -76,4 +82,4 @@ jobs: ${{ env.CHANGES }} title: "⬆️ Bump files with dotnet-file sync" body: ${{ env.CHANGES }} - token: ${{ env.GH_TOKEN }} \ No newline at end of file + token: ${{ env.GH_TOKEN }} diff --git a/.github/workflows/includes.yml b/.github/workflows/includes.yml index f839bbb..dcab8f7 100644 --- a/.github/workflows/includes.yml +++ b/.github/workflows/includes.yml @@ -1,4 +1,4 @@ -name: +Mβ–Ό includes +name: +Mᐁ includes on: workflow_dispatch: push: @@ -11,19 +11,21 @@ jobs: includes: runs-on: ubuntu-latest steps: + - name: πŸ€– defaults + uses: devlooped/actions-bot@v1 + with: + name: ${{ secrets.BOT_NAME }} + email: ${{ secrets.BOT_EMAIL }} + gh_token: ${{ secrets.GH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: 🀘 checkout uses: actions/checkout@v2 + with: + token: ${{ env.GH_TOKEN }} - - name: πŸ” defaults - uses: ./.github/workflows/defaults - env: - GH_TOKEN_SECRET: ${{ secrets.GH_TOKEN }} - BOT_NAME_SECRET: ${{ secrets.BOT_NAME }} - BOT_EMAIL_SECRET: ${{ secrets.BOT_EMAIL }} - BOT_AUTHOR_SECRET: ${{ secrets.BOT_AUTHOR }} - - - name: +Mβ–Ό includes - uses: devlooped/actions-include@v4 + - name: +Mᐁ includes + uses: devlooped/actions-include@v1 - name: ✍ pull request uses: peter-evans/create-pull-request@v3 @@ -31,10 +33,10 @@ jobs: base: main branch: markdown-includes delete-branch: true - labels: dependencies + labels: docs author: ${{ env.BOT_AUTHOR }} committer: ${{ env.BOT_AUTHOR }} - commit-message: +Mβ–Ό includes - title: +Mβ–Ό includes - body: +Mβ–Ό includes - token: ${{ env.GH_TOKEN }} \ No newline at end of file + commit-message: +Mᐁ includes + title: +Mᐁ includes + body: +Mᐁ includes + token: ${{ env.GH_TOKEN }} diff --git a/.github/workflows/sponsor.yml b/.github/workflows/sponsor.yml new file mode 100644 index 0000000..2e8a31c --- /dev/null +++ b/.github/workflows/sponsor.yml @@ -0,0 +1,18 @@ +name: sponsor ❀️ +on: + issues: + types: [opened, edited, reopened] + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + sponsor: + runs-on: ubuntu-latest + steps: + - name: 🀘 checkout + uses: actions/checkout@v2 + + - name: ❀️ sponsor + uses: devlooped/actions-sponsor@main + with: + token: ${{ secrets.GH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/sponsors.ps1 b/.github/workflows/sponsors.ps1 deleted file mode 100644 index 791fd7c..0000000 --- a/.github/workflows/sponsors.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -$event = Get-Content -Path $env:GITHUB_EVENT_PATH | ConvertFrom-Json -$author = $event.issue ? $event.issue.user.node_id : $event.pull_request.user.node_id - -if ($author -eq $null) { - throw 'No user id found' -} - -gh auth status - -echo "Looking up sponsorship from $env:GITHUB_ACTOR ..." - -$query = gh api graphql --paginate -f owner='devlooped' -f query=' -query($owner: String!, $endCursor: String) { - organization (login: $owner) { - sponsorshipsAsMaintainer (first: 100, after: $endCursor) { - nodes { - sponsorEntity { - ... on Organization { id, name } - ... on User { id, name } - } - tier { monthlyPriceInDollars } - } - pageInfo { - hasNextPage - endCursor - } - } - } -} -' - -$amount = - $query | - ConvertFrom-Json | - select @{ Name='nodes'; Expression={$_.data.organization.sponsorshipsAsMaintainer.nodes}} | - select -ExpandProperty nodes | - where { $_.sponsorEntity.id -eq $author } | - select -ExpandProperty tier | - select -ExpandProperty monthlyPriceInDollars - -if ($null -eq $amount) { - echo "Author is not a sponsor! Nothing left to do." - return -} - -echo "Author is a sponsor!" - -$headers = @{ 'Accept'='application/vnd.github.v3+json;charset=utf-8'; 'Authorization' = "bearer $env:GH_TOKEN" } - -# Try creating the labels, ignore errors (i.e. already created) -iwr -Body '{ "name":"sponsor :purple_heart:", "color":"ea4aaa", "description":"sponsor" }' "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/labels" -Method Post -Headers $headers -SkipHttpErrorCheck -UseBasicParsing | select -ExpandProperty StatusCode -iwr -Body '{ "name":"sponsor :yellow_heart:", "color":"ea4aaa", "description":"sponsor++" }' "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/labels" -Method Post -Headers $headers -SkipHttpErrorCheck -UseBasicParsing | select -ExpandProperty StatusCode - -$number = $event.issue ? $event.issue.number : $event.pull_request.number -$labels = $amount -ge 100 ? '{"labels":["sponsor :yellow_heart:"]}' : '{"labels":["sponsor :purple_heart:"]}' - -iwr -Body $labels "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/issues/$number/labels" -Method Post -Headers $headers -SkipHttpErrorCheck -UseBasicParsing | select -ExpandProperty StatusCode - -echo 'Label applied' diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml deleted file mode 100644 index 23158a7..0000000 --- a/.github/workflows/sponsors.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Runs on new issues/PRs and applies sponsor labels - -name: sponsors -on: - issues: - types: [opened] - -jobs: - sponsors: - runs-on: windows-latest - steps: - - name: 🀘 checkout - uses: actions/checkout@v2 - - - name: πŸ”½ gh - run: | - iex "& {$(irm get.scoop.sh)} -RunAsAdmin" - scoop install gh - - - name: πŸ’› sponsors - run: ./.github/workflows/sponsors.ps1 - env: - GH_TOKEN: ${{ secrets.DEVLOOPED_TOKEN }} diff --git a/.netconfig b/.netconfig index 1b690be..82044ef 100644 --- a/.netconfig +++ b/.netconfig @@ -54,13 +54,13 @@ weak [file ".github/workflows/changelog.yml"] url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.yml - sha = 15e94864c0806dd899b4b8f7bb4fc8b99a62111a - etag = 3a0f1fb7819245b4b35c918f86c177ffa48cbecd153c62be2e245c02ca993508 + sha = 5406d907e0bf87dd1b4375f2ae2279dd775ed672 + etag = 034c69fefe727b412a52e49964646131b899d6e7bb1576fe9d4a4db9208675ff weak [file ".github/workflows/dotnet-file.yml"] url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file.yml - sha = d94ddb1384daf67602be0c4e02fad6c86b6c79b3 - etag = a180d38577ce5f69caf05034d8332e99cb837fe8cfdfc0dee59cf9b6e4dbb61d + sha = aed791a3a35919e3088cd2bde604cbae6f47b393 + etag = 0f7649805f5e84fba5104339bfd0c21ac4747b65186b16eab39f863e2db7a3e1 weak [file ".github/workflows/publish.yml"] url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml @@ -132,16 +132,6 @@ sha = e8f3774884afda36ac177c4193929d24d7901de9 etag = 42fdc888e07b492cccc6fd29972bd9ea6f13691a3fdf057e07f3f8eec9330b7a weak -[file ".github/workflows/sponsors.ps1"] - url = https://github.com/devlooped/.github/blob/main/.github/workflows/sponsors.ps1 - sha = 11f5c27cfdb304436ef0b7ee27ff333cda31ef65 - etag = 57a303125f3367b68ad0700d89ff4ba57cb29b33b303903488c9c8638d0bf735 - weak -[file ".github/workflows/sponsors.yml"] - url = https://github.com/devlooped/.github/blob/main/.github/workflows/sponsors.yml - sha = 8b6384e91fdfcf8f3cc9b3b262a9ca2a1095d06a - etag = 2c05a753600913f546c37a2ea9393b3ede3b6f8473e5c2d53462aa7342af7078 - weak [file "Gemfile"] url = https://github.com/devlooped/.github/blob/main/Gemfile sha = f2dc1370469bec1b2d32d82faf659b050cdc7e2a @@ -164,21 +154,16 @@ weak [file ".github/workflows/includes.yml"] url = https://github.com/devlooped/oss/blob/main/.github/workflows/includes.yml - sha = d94ddb1384daf67602be0c4e02fad6c86b6c79b3 - etag = d390b05199c9812efa33c1f49c59e80a14cfcb46240f08eb8981b718d659f7c1 - weak -[file "docs/footer.md"] - url = https://github.com/devlooped/oss/blob/main/docs/footer.md - sha = 06e7171fa1d1f49300278ebf11020b8d03ef44ac - etag = 2e47c8bba7ea60a722ce2bfc8a0222e27bc33f25073486523710383540dc6257 + sha = 5406d907e0bf87dd1b4375f2ae2279dd775ed672 + etag = 75f05e99fab00c735305d85ad2dc599aff6fd72d5b38536e8c80df8e73b43de2 weak [file "docs/sponsors.md"] url = https://github.com/devlooped/sponsors/blob/main/sponsors.md - sha = 0a67f1a43b12eabc5fe3229fd9c9239dd97fc645 - etag = 39e8d18b010c445fb65046c8504c1a95d66d5b4c6aff2f859d030a98faf182de + sha = 4722856ec9385044e9a553aa6b85f2f3728098dc + etag = 32d12ff9caf2320f57c78120d69c95798c8aca6ef8b946bff7ad678c0c40a656 weak -[file ".github/workflows/defaults/action.yml"] - url = https://github.com/devlooped/oss/blob/main/.github/workflows/defaults/action.yml - sha = 4253d8ae0f92625f475fabba36b67b2df7cb3806 - etag = 2db4daaf02093f57836b6045053e72d846493935d5129b6b7ac3f5aea9dca4b4 +[file ".github/workflows/sponsor.yml"] + url = https://github.com/devlooped/.github/blob/main/.github/workflows/sponsor.yml + sha = 4108ce6017b20ceb8d024f6675c1ea2573b317e0 + etag = 7551f063d8b04d25dd100d7e5db792f840c5173ee74c4805b6a69b8b6bfe20b6 weak diff --git a/docs/footer.md b/docs/footer.md deleted file mode 100644 index 83d5809..0000000 --- a/docs/footer.md +++ /dev/null @@ -1,8 +0,0 @@ -# Sponsors - - - -[![Sponsor this project](https://raw.githubusercontent.com/devlooped/sponsors/main/sponsor.png "Sponsor this project")](https://github.com/sponsors/devlooped) -  - -[Learn more about GitHub Sponsors](https://github.com/sponsors) diff --git a/docs/sponsors.md b/docs/sponsors.md index fb26597..1ca5846 100644 --- a/docs/sponsors.md +++ b/docs/sponsors.md @@ -1,8 +1,8 @@ -[![Kirill Osenkov](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/KirillOsenkov.png "Kirill Osenkov")](https://github.com/KirillOsenkov) -[![C. Augusto Proiete](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/augustoproiete.png "C. Augusto Proiete")](https://github.com/augustoproiete) -[![SandRock](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/sandrock.png "SandRock")](https://github.com/sandrock) -[![Amazon Web Services](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/aws.png "Amazon Web Services")](https://github.com/aws) -[![Christian Findlay](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/MelbourneDeveloper.png "Christian Findlay")](https://github.com/MelbourneDeveloper) [![Clarius Org](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/clarius.png "Clarius Org")](https://github.com/clarius) +[![Christian Findlay](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/MelbourneDeveloper.png "Christian Findlay")](https://github.com/MelbourneDeveloper) +[![C. Augusto Proiete](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/augustoproiete.png "C. Augusto Proiete")](https://github.com/augustoproiete) +[![Kirill Osenkov](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/KirillOsenkov.png "Kirill Osenkov")](https://github.com/KirillOsenkov) [![MFB Technologies, Inc.](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/MFB-Technologies-Inc.png "MFB Technologies, Inc.")](https://github.com/MFB-Technologies-Inc) +[![Amazon Web Services](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/aws.png "Amazon Web Services")](https://github.com/aws) +[![SandRock](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/sandrock.png "SandRock")](https://github.com/sandrock)