@@ -5,39 +5,46 @@ on:
55 branches: [master]
66 pull_request:
77 branches: [master]
8− workflow_dispatch:
9− inputs:
10− release:
11− description: Release the new version?
12− required: false
13− default: "true"
14− version:
15− description: The version to release
16− required: true
8+ release:
9+ types: [prereleased]
1710
1811jobs:
19− build-github-action-image:
12+ Linux:
2013 runs-on: ubuntu-latest
21−
2214 steps:
15+ - name: Increase swap
16+ shell: bash
17+ run: |
18+ free -h
19+
20+ sudo swapoff /mnt/swapfile
21+ sudo fallocate -l 12G /mnt/swapfile
22+ sudo mkswap /mnt/swapfile
23+ sudo swapon /mnt/swapfile
24+
25+ free -h
26+
2327 - uses: actions/checkout@v2
2428 with:
2529 submodules: recursive
2630
2731 - name: Common setup
2832 uses: ./.github/actions/common_setup
33+
34+ - name: Build Linux static binary
35+ run: |
36+ cp $(nix-build -A compaRESTStaticBin -j auto)/bin/compaREST compaREST
37+
38+ - name: Upload compaREST Linux Binary
39+ uses: actions/upload-artifact@v2
2940 with:
30− cachixSigningKey: ${{ secrets.CACHIX_SIGNING_KEY }}
41+ name: compaREST-Linux
42+ path: compaREST
3143
3244 - name: Build Github Action Docker Image
3345 run: |
3446 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
36−
37− - name: Build Linux static binary
38− run: |
39− mkdir compaREST-binary
40− cp $(nix-build -A compaRESTBin -j auto)/bin/compaREST compaREST-binary/compaREST
47+ cp $(nix-build -A compaRESTImage-j auto) compaREST-image.tar.gz
4148
4249 - name: Upload compaREST Github Action Image
4350 uses: actions/upload-artifact@v2
@@ -51,60 +58,80 @@ jobs:
5158 name: compaREST-image
5259 path: compaREST-image.tar.gz
5360
54− - name: Upload compaREST Linux Binary
55− uses: actions/upload-artifact@v2
56− with:
57− name: compaREST-linux
58− path: compaREST-binary/compaREST
61+ - name: Install skopeo
62+ shell: bash
63+ run: |
64+ sudo apt-get -y update
65+ sudo apt-get -y install skopeo
5966
60− - name: Push Nightly Docker Images to DockerHub
61− if: github.ref == 'refs/heads/master' && github.event_name == 'push'
62− uses: ./.github/actions/push_docker_images
67+ - name: Login to DockerHub
68+ if: github.event_name == 'release'
69+ uses: docker/login-action@v1.10.0
6370 with:
64− tag: nightly
65− docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
66− docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
71+ username: ${{ secrets.DOCKERHUB_USERNAME }}
72+ password: ${{ secrets.DOCKERHUB_TOKEN }}
6773
68− release:
69− name: Release
70− if: github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true'
71− needs: [build-github-action-image]
72− runs-on: "ubuntu-latest"
74+ - name: Push Docker Images to DockerHub
75+ if: github.event_name == 'release'
76+ shell: bash
77+ run: |
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 }}
80+
81+ macOS:
82+ runs-on: ubuntu-latest
7383 steps:
7484 - uses: actions/checkout@v2
85+ with:
86+ submodules: recursive
87+
7588 - name: Common setup
7689 uses: ./.github/actions/common_setup
77− with:
78− cachixSigningKey: ${{ secrets.CACHIX_SIGNING_KEY }}
7990
80− - name: Push Docker Release Images to DockerHub
81− uses: ./.github/actions/push_docker_images
91+ - name: Build macOS binary bundle
92+ run: |
93+ cp -LR $(nix-build -A macOSCompaRESTBundle -j auto)/bin/compaREST compaREST
94+
95+ - name: Upload macOS compaREST bundle
96+ uses: actions/upload-artifact@v2
8297 with:
83− tag: ${{ github.event.inputs.version }}
84− docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
85− docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
98+ name: compaREST-macOS
99+ path: compaREST
100+
101+ Linux-Windows:
102+ runs-on: ubuntu-latest
103+ steps:
104+ - name: Increase swap
105+ shell: bash
106+ run: |
107+ free -h
108+
109+ sudo swapoff /mnt/swapfile
110+ sudo fallocate -l 12G /mnt/swapfile
111+ sudo mkswap /mnt/swapfile
112+ sudo swapon /mnt/swapfile
86113
87− - name: Push Docker latest Images to DockerHub
88− uses: ./.github/actions/push_docker_images
114+ free -h
115+
116+ - uses: actions/checkout@v2
89117 with:
90− tag: latest
91− docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
92− docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
118+ submodules: recursive
119+
120+ - name: Common setup
121+ uses: ./.github/actions/common_setup
93122
94− - uses: actions/download-artifact@v2
95− - name: Zip and move
123+ - name: Build Windows binary
96124 run: |
97− chmod +x compaREST-linux/compaREST
98− zip compaREST-linux compaREST-linux/compaREST
125+ cp -LR $(nix-build -A WindowsCompaRESTBin -j auto)/bin compaREST
99126
100− mv compaREST-Github-Action-image/* .
101− mv compaREST-image/* .
102− - uses: "marvinpinto/action-automatic-releases@latest"
127+ - name: Upload compaREST Linux Binary
128+ uses: actions/upload-artifact@v2
129+ with:
130+ name: compaREST-Windows
131+ path: compaREST
132+
133+ - name: Upload Windows compaREST bundle
134+ uses: actions/upload-artifact@v2
103135 with:
104− repo_token: "${{ secrets.GITHUB_TOKEN }}"
105− automatic_release_tag: "latest"
106− prerelease: false
107− title: "${{ github.event.inputs.version }}"
108− files: |
109− *.zip
110− *.tar.gz
136+ name: compaREST-Windows
137+ path: compaREST