Bump softprops/action-gh-release from 2 to 3 (#24) #210
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Artifacts | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - '**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| actions: read | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| arch: amd64 | |
| - os: ubuntu-22.04-arm | |
| arch: arm64 | |
| - os: macos-latest | |
| arch: arm64 | |
| - os: windows-latest | |
| arch: amd64 | |
| - os: windows-11-arm | |
| arch: arm64 | |
| fail-fast: false | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dlang-community/setup-dlang@v2 | |
| with: | |
| compiler: ldc-latest | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| if: runner.os == 'Windows' | |
| with: | |
| arch: ${{ matrix.arch }} | |
| - name: Set CURL_CA_BUNDLE for Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| Invoke-WebRequest -Uri https://curl.se/ca/cacert.pem -OutFile curl-ca-bundle.crt | |
| echo "CURL_CA_BUNDLE=$($PWD.Path)\curl-ca-bundle.crt" >> $env:GITHUB_ENV | |
| - name: Set DUB_ARCH for windows-11-arm | |
| if: matrix.os == 'windows-11-arm' | |
| shell: bash | |
| run: | | |
| echo "DUB_ARCH=--arch=arm64-windows-msvc" >> $GITHUB_ENV | |
| echo "CC=cl.exe" >> $GITHUB_ENV | |
| echo "CXX=cl.exe" >> $GITHUB_ENV | |
| - name: Build | |
| run: | | |
| dub -b release ${{ env.DUB_ARCH }} | |
| - name: Tests | |
| run: | | |
| dub -b release ${{ env.DUB_ARCH }} -- install -v | |
| dub -b release ${{ env.DUB_ARCH }} -- install ldc2-master -v | |
| dub -b release ${{ env.DUB_ARCH }} -- list -v | |
| dub -b release ${{ env.DUB_ARCH }} -- uninstall ldc2-1.42.0 -v | |
| dub -b release ${{ env.DUB_ARCH }} -- list -v | |
| dub -b release ${{ env.DUB_ARCH }} -- run -v -- --version | |
| - name: Compress artifacts (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| Compress-Archive -Path bin/* -DestinationPath bin/ldcup-${{ matrix.os }}-${{ matrix.arch }}.zip | |
| - name: Compress artifacts (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cd bin && tar -cJf ldcup-${{ matrix.os }}-${{ matrix.arch }}.tar.xz * | |
| - uses: actions/upload-artifact@v7 | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
| with: | |
| name: ldcup-${{ matrix.os }}-${{ matrix.arch }} | |
| path: bin/ldcup-${{ matrix.os }}-${{ matrix.arch }}.* | |
| - uses: softprops/action-gh-release@v3 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: 'bin/ldcup-${{ matrix.os }}-${{ matrix.arch }}.*' | |
| prerelease: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| freebsd: | |
| strategy: | |
| matrix: | |
| arch: [amd64] | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Run FreeBSD VM | |
| uses: vmactions/freebsd-vm@v1 | |
| with: | |
| usesh: true | |
| prepare: | | |
| pkg install -y curl dub ldc | |
| run: | | |
| dub -b release | |
| dub -b release -- install -v | |
| dub -b release -- install ldc2-master -v | |
| dub -b release -- list -v | |
| dub -b release -- uninstall ldc2-1.42.0 -v | |
| dub -b release -- list -v | |
| dub -b release -- run -v -- --version | |
| tar -cJf bin/ldcup-freebsd14.3-${{ matrix.arch }}.tar.xz -C bin . | |
| - uses: actions/upload-artifact@v7 | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
| with: | |
| name: ldcup-freebsd-14.3-amd64 | |
| path: bin/ldcup-freebsd14.3-${{ matrix.arch }}.tar.xz | |
| - uses: softprops/action-gh-release@v3 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: 'bin/ldcup-freebsd14.3-${{ matrix.arch }}.tar.xz' | |
| prerelease: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| alpine: | |
| strategy: | |
| matrix: | |
| arch: [amd64] | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| container: | |
| image: alpine:latest | |
| defaults: | |
| run: | |
| shell: sh | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Prepare | |
| run: | | |
| apk update | |
| apk add --no-cache xz tar ldc dub clang | |
| - name: Build | |
| run: | | |
| dub -b release | |
| touch $HOME/.profile | |
| - name: Tests | |
| run: | | |
| dub -b release -- install ldc2-master -v | |
| dub -b release -- list -v | |
| source $HOME/.profile | |
| dub -b release -- install redub -v | |
| dub -b release -- run -v -- --version | |
| - name: Compress artifacts | |
| run: | | |
| cd bin && tar -cJf ldcup-alpine-${{ matrix.arch }}.tar.xz * | |
| - uses: actions/upload-artifact@v7 | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
| with: | |
| name: ldcup-alpine-${{ matrix.arch }} | |
| path: bin/ldcup-alpine-${{ matrix.arch }}.tar.xz | |
| - uses: softprops/action-gh-release@v3 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: 'bin/ldcup-alpine-${{ matrix.arch }}.tar.xz' | |
| prerelease: true | |
| token: ${{ secrets.GITHUB_TOKEN }} |