Skip to content

Commit

Permalink
Add CI/CD workflow for gh extension
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Sep 6, 2024
1 parent ee549a8 commit 9d3517a
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 165 deletions.
102 changes: 0 additions & 102 deletions .github/workflows/build.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: ci/cd
on:
pull_request:
workflow_dispatch:
push:
branches: [main]
release:
types: [released]

env:
RestoreUseSkipNonexistentTargets: true
Configuration: Release

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v3

- name: 📦 publish
run: |
dotnet publish src/Extension/Extension.csproj -r win-x64 -o bin/win-x64
dotnet publish src/Extension/Extension.csproj -r osx-x64 -o bin/osx-x64
dotnet publish src/Extension/Extension.csproj -r osx-arm64 -o bin/osx-arm64
dotnet publish src/Extension/Extension.csproj -r linux-x64 -o bin/linux-x64
- name: ➡️ artifacts
run: |
mkdir -p ${{ runner.temp }}/staging
cp bin/win-x64/gh-sponsors.exe ${{ runner.temp }}/staging/sponsors-windows-amd64.exe
cp bin/osx-x64/gh-sponsors ${{ runner.temp }}/staging/sponsors-darwin-amd64
cp bin/osx-arm64/gh-sponsors ${{ runner.temp }}/staging/sponsors-darwin-arm64
cp bin/linux-x64/gh-sponsors ${{ runner.temp }}/staging/sponsors-linux-amd64
- name: ⬆️ upload
uses: actions/upload-artifact@v3
with:
name: executables
path: ${{ runner.temp }}/staging/*

publish:
runs-on: windows-latest
continue-on-error: true
needs: build
if: github.event_name == 'release'
defaults:
run:
shell: pwsh
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@v3
with:
token: ${{ env.GH_TOKEN }}

- name: ⬇️ artifacts
uses: actions/download-artifact@v3
with:
name: executables
path: ${{ runner.temp }}/dist

- name: 🚀 release
run: |
dotnet tool update -g dotnet-gcm
dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN
gci ${{ runner.temp }}/dist | %{ gh release upload ${{ github.event.release.tag_name }} $_.FullName }
57 changes: 0 additions & 57 deletions .github/workflows/publish.yml

This file was deleted.

8 changes: 2 additions & 6 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
weak
[file ".github/workflows/build.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
sha = 7ec91019eddb4fc7e0b09118538b256087f82e18
etag = 35b2a5b03c26cbe7522e30b2b987e04991e8ba18accd38b7ebd88191f1698c2d
weak
skip
[file ".github/workflows/changelog.config"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.config
sha = 08d83cb510732f861416760d37702f9f55bd7f9e
Expand All @@ -59,9 +57,7 @@
weak
[file ".github/workflows/publish.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
sha = fcfc66a8735f5338f97c7292db5f4ee83a712254
etag = e3269a4ec0a33deccb7e35b51178aa34831146a709af435fd10e659cd4dd967b
weak
skip
[file ".github/workflows/triage.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/triage.yml
sha = 33000c0c4ab4eb4e0e142fa54515b811a189d55c
Expand Down

0 comments on commit 9d3517a

Please sign in to comment.