diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ac09194..712136c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,7 +43,7 @@ jobs: run: | mkdir /home/runner/work/release ls /home/runner/work/clis/ - zip -r /home/runner/work/release/clisample-$VERSION-$RID.zip /home/runner/work/clis/$RID/* + zip -j /home/runner/work/release/clisample-$VERSION-$RID.zip /home/runner/work/clis/$RID/* - name: Upload artifacts uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/release_unstable.yaml b/.github/workflows/release_unstable.yaml new file mode 100644 index 0000000..13d24a3 --- /dev/null +++ b/.github/workflows/release_unstable.yaml @@ -0,0 +1,74 @@ +name: Publish Release from Tag + +on: + push: + tags: + - "*.*.*-beta*" + - "*.*.*-rc*" + +jobs: + + build: + name: Build release artifacts + runs-on: ubuntu-latest + strategy: + matrix: + targets: + [ + "linux-x64", + "linux-musl-x64", + "linux-arm", + "linux-arm64", + "osx-x64", + "win-x64", + "win-x86", + "win-arm", + "win-arm64", + ] + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Set up .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: "6.0.x" + - name: Publish .NET app + env: + RID: ${{ matrix.targets }} + VERSION: ${{ github.ref_name }} + run: dotnet publish -c Release -r $RID --self-contained true -p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true CliSample/CliSample.csproj --output /home/runner/work/clis/$RID + - name: Package assets + env: + RID: ${{ matrix.targets }} + VERSION: ${{ github.ref_name }} + run: | + mkdir /home/runner/work/release + ls /home/runner/work/clis/ + zip -j /home/runner/work/release/clisample-$VERSION-$RID.zip /home/runner/work/clis/$RID/* + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: clisample-${{ github.ref_name }}-${{ matrix.targets }}.zip + path: "/home/runner/work/release/clisample-${{ github.ref_name }}-${{ matrix.targets }}.zip" + + publish: + name: Publish release + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Create .artifacts dir + run: mkdir .artifacts + - uses: actions/download-artifact@v2 + with: + path: .artifacts + - name: Generate Changelog + run: git log --pretty="format:[%h] %s" $(git describe --tags --abbrev=0 @^)..@ > .artifacts/CHANGELOG.txt + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + prerelease: true + files: .artifacts/** + body_path: .artifacts/CHANGELOG.txt \ No newline at end of file