diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7e8697..30791c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,26 +24,3 @@ jobs: project_path: ${{ env.SLN }} set_check_status_from_test_outcome: true github_token: ${{ secrets.GITHUB_TOKEN }} - binaries: - needs: build - runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' }} - name: create standalone binaries - strategy: - matrix: - rid: - - win-x64 - - linux-x64 - - osx-x64 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "5.0.x" - - name: Create the self-contained binary - run: dotnet build --configuration Release "${APP}" -r ${{ matrix.rid }} -o out/${{ matrix.rid }} - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.rid }} binary - path: out/${{ matrix.rid }}/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f2bcfbe --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + push: + tags: + - "v*" + +env: + APP: "./src/XlsxCompare" + +jobs: + verify_commit: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Verify commit exists in origin/main + run: | + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git branch --remote --contains | grep origin/main + + binaries: + needs: verify_commit + runs-on: ubuntu-latest + name: create standalone binaries + strategy: + matrix: + rid: + - win-x64 + - linux-x64 + - osx-x64 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: "5.0.x" + - name: Create the self-contained binary + run: dotnet publish --configuration Release "${APP}" -r ${{ matrix.rid }} -o out/${{ matrix.rid }} --self-contained true + - name: rename so the release can have a flat list of files + run: cp out/${{ matrix.rid }}/XlsxCompare XlsxCompare-${{ matrix.rid }} || cp out/${{ matrix.rid }}/XlsxCompare.exe XlsxCompare-${{ matrix.rid }}.exe + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.rid }} binary + path: XlsxCompare* + + release: + needs: binaries + runs-on: ubuntu-latest + steps: + - name: download all binaries + uses: actions/download-artifact@v2 + - uses: "marvinpinto/action-automatic-releases@v1.1.1" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + **/XlsxCompare* diff --git a/src/XlsxCompare/XlsxCompare.csproj b/src/XlsxCompare/XlsxCompare.csproj index b853c30..b249850 100644 --- a/src/XlsxCompare/XlsxCompare.csproj +++ b/src/XlsxCompare/XlsxCompare.csproj @@ -8,7 +8,6 @@ true - true true true embedded