@@ -5,39 +5,46 @@ on:
5 branches: [master]
5 branches: [master]
6 pull_request:
6 pull_request:
7 branches: [master]
7 branches: [master]
8− workflow_dispatch:
8+ release:
9− inputs:
9+ types: [prereleased]
11− description: Release the new version?
15− description: The version to release
19− build-github-action-image:
12+ Linux:
20 runs-on: ubuntu-latest
13 runs-on: ubuntu-latest
15+ - name: Increase swap
20+ sudo swapoff /mnt/swapfile
21+ sudo fallocate -l 12G /mnt/swapfile
22+ sudo mkswap /mnt/swapfile
23+ sudo swapon /mnt/swapfile
23 - uses: actions/checkout@v2
27 - uses: actions/checkout@v2
25 submodules: recursive
29 submodules: recursive
27 - name: Common setup
31 - name: Common setup
28 uses: ./.github/actions/common_setup
32 uses: ./.github/actions/common_setup
34+ - name: Build Linux static binary
36+ cp $(nix-build -A compaRESTStaticBin -j auto)/bin/compaREST compaREST
38+ - name: Upload compaREST Linux Binary
39+ uses: actions/upload-artifact@v2
30− cachixSigningKey: ${{ secrets.CACHIX_SIGNING_KEY }}
41+ name: compaREST-Linux
32 - name: Build Github Action Docker Image
44 - name: Build Github Action Docker Image
34 cp $(nix-build -A compaRESTGithubAction -j auto) compaREST-Github-Action-image.tar.gz
46 cp $(nix-build -A compaRESTGithubAction -j auto) compaREST-Github-Action-image.tar.gz
35− cp $(nix-build -A compaREST -j auto) compaREST-image.tar.gz
47+ cp $(nix-build -A compaRESTImage-j auto) compaREST-image.tar.gz
37− - name: Build Linux static binary
39− mkdir compaREST-binary
40− cp $(nix-build -A compaRESTBin -j auto)/bin/compaREST compaREST-binary/compaREST
42 - name: Upload compaREST Github Action Image
49 - name: Upload compaREST Github Action Image
43 uses: actions/upload-artifact@v2
50 uses: actions/upload-artifact@v2
@@ -51,60 +58,80 @@ jobs:
51 name: compaREST-image
58 name: compaREST-image
52 path: compaREST-image.tar.gz
59 path: compaREST-image.tar.gz
54− - name: Upload compaREST Linux Binary
61+ - name: Install skopeo
55− uses: actions/upload-artifact@v2
62+ shell: bash
57− name: compaREST-linux
64+ sudo apt-get -y update
58− path: compaREST-binary/compaREST
65+ sudo apt-get -y install skopeo
60− - name: Push Nightly Docker Images to DockerHub
67+ - name: Login to DockerHub
61− if: github.ref == 'refs/heads/master' && github.event_name == 'push'
68+ if: github.event_name == 'release'
62− uses: ./.github/actions/push_docker_images
69+ uses: docker/login-action@v1.10.0
65− docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
71+ username: ${{ secrets.DOCKERHUB_USERNAME }}
66− docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
72+ password: ${{ secrets.DOCKERHUB_TOKEN }}
68− release:
74+ - name: Push Docker Images to DockerHub
70− if: github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true'
75+ if: github.event_name == 'release'
71− needs: [build-github-action-image]
76+ shell: bash
78+ skopeo copy docker-archive:$(nix-build -A compaRESTGithubAction -j auto) docker://typeable/comparest-github-action:${{ github.event.payload.name }}
79+ skopeo copy docker-archive:$(nix-build -A compaRESTImage -j auto) docker://typeable/comparest:${{ github.event.payload.name }}
72− runs-on: "ubuntu-latest"
82+ runs-on: ubuntu-latest
74 - uses: actions/checkout@v2
84 - uses: actions/checkout@v2
86+ submodules: recursive
75 - name: Common setup
88 - name: Common setup
76 uses: ./.github/actions/common_setup
89 uses: ./.github/actions/common_setup
78− cachixSigningKey: ${{ secrets.CACHIX_SIGNING_KEY }}
80− - name: Push Docker Release Images to DockerHub
91+ - name: Build macOS binary bundle
81− uses: ./.github/actions/push_docker_images
92+ run: |
93+ cp -LR $(nix-build -A macOSCompaRESTBundle -j auto)/bin/compaREST compaREST
95+ - name: Upload macOS compaREST bundle
96+ uses: actions/upload-artifact@v2
83− tag: ${{ github.event.inputs.version }}
98+ name: compaREST-macOS
84− docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
99+ path: compaREST
85− docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
100+
102+ runs-on: ubuntu-latest
104+ - name: Increase swap
109+ sudo swapoff /mnt/swapfile
110+ sudo fallocate -l 12G /mnt/swapfile
111+ sudo mkswap /mnt/swapfile
112+ sudo swapon /mnt/swapfile
87− - name: Push Docker latest Images to DockerHub
114+ free -h
88− uses: ./.github/actions/push_docker_images
115+
116+ - uses: actions/checkout@v2
90− tag: latest
118+ submodules: recursive
91− docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
119+
92− docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
120+ - name: Common setup
121+ uses: ./.github/actions/common_setup
94− - uses: actions/download-artifact@v2
123+ - name: Build Windows binary
97− chmod +x compaREST-linux/compaREST
125+ cp -LR $(nix-build -A WindowsCompaRESTBin -j auto)/bin compaREST
98− zip compaREST-linux compaREST-linux/compaREST
100− mv compaREST-Github-Action-image/* .
127+ - name: Upload compaREST Linux Binary
128+ uses: actions/upload-artifact@v2
101− mv compaREST-image/* .
130+ name: compaREST-Windows
102− - uses: "marvinpinto/action-automatic-releases@latest"
131+ path: compaREST
133+ - name: Upload Windows compaREST bundle
134+ uses: actions/upload-artifact@v2
104− repo_token: "${{ secrets.GITHUB_TOKEN }}"
136+ name: compaREST-Windows
105− automatic_release_tag: "latest"
137+ path: compaREST
107− title: "${{ github.event.inputs.version }}"