diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 96706d918..bbe10cf77 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -7,7 +7,7 @@ on: push name: OpenOCD Snapshot jobs: - package: + package-windows: runs-on: [ubuntu-20.04] env: DL_DIR: ../downloads @@ -120,4 +120,59 @@ jobs: draft: false artifacts: ${{ env.ARTIFACT_PATH }} prerelease: ${{ env.IS_PRE_RELEASE }} - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} + package-linux: + runs-on: ubuntu-latest + outputs: + artifact-name: ${{ steps.package-linux.outputs.artifact-name }} + steps: + - uses: actions/checkout@v1 + - name: Package OpenOCD for Linux + id: package-linux + uses: ./microsoft/static-linux-build + - name: Publish OpenOCD packaged for Linux + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.package-linux.outputs.artifact-name }} + path: ${{ steps.package-linux.outputs.artifact-name }} + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: [package-windows, package-linux] + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1.1.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + - name: Download OpenOCD packaged for Windows + uses: actions/download-artifact@v2 + with: + name: ${{ needs.package-windows.outputs.artifact-name }} + - name: Download OpenOCD packaged for Linux + uses: actions/download-artifact@v2 + with: + name: ${{ needs.package-linux.outputs.artifact-name }} + - name: Release OpenOCD packaged for Linux + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ needs.package-linux.outputs.artifact-name }} + asset_name: ${{ needs.package-linux.outputs.artifact-name }} + asset_content_type: application/gzip + - name: Release OpenOCD packaged for Windows + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ needs.package-windows.outputs.artifact-name }} + asset_name: ${{ needs.package-windows.outputs.artifact-name }} + asset_content_type: application/gzip \ No newline at end of file