git.iko.soy/typeable/octopod
on master help sign in
Merged build and release scripts (#133)

* Merged build and release scripts * swapped server and cli images back

commita03af4562324d9bfaec2600957f71540f7507120 authoriko <ilyakooo0@gmail.com> dateSun 10 Oct 2021, 19:46 (5 years ago) parent1201df2
2 files changed+50−48
.github/workflows/build.yaml+50−4 .github/workflows/release.yaml−44
.github/workflows/build.yaml+50−4
@@ -1,4 +1,4 @@
1−name: Build
1+name: Build and release
22on:
33 push:
44 branches:
@@ -10,6 +10,15 @@ on:
1010 - master
1111 - develop
1212 - staging
13+ workflow_dispatch:
14+ inputs:
15+ release:
16+ description: Release the new version?
17+ required: false
18+ default: "true"
19+ version:
20+ description: The version to release
21+ required: true
1322
1423jobs:
1524 check-formatting:
@@ -74,7 +83,7 @@ jobs:
7483 run: nix-build ./nix -j auto
7584
7685 - name: Push Nightly Docker Images to DockerHub
77− if: github.ref == 'refs/heads/master'
86+ if: github.ref == 'refs/heads/master' && github.event_name == 'push'
7887 uses: ./.github/actions/push_docker_images
7988 with:
8089 tag: nightly
@@ -83,8 +92,8 @@ jobs:
8392
8493 - name: Rename Docker image archives
8594 run: |
86− cp $(nix-build ./nix -j auto -A octopod-server-container) octo-cli-image.tar.gz
87− cp $(nix-build ./nix -j auto -A octo-cli-container) octopod-server-image.tar.gz
95+ cp $(nix-build ./nix -j auto -A octo-cli-container) octo-cli-image.tar.gz
96+ cp $(nix-build ./nix -j auto -A octopod-server-container) octopod-server-image.tar.gz
8897
8998 - name: Upload octo CLI Image
9099 uses: actions/upload-artifact@v2
@@ -97,3 +106,40 @@ jobs:
97106 with:
98107 name: octopod-server-image
99108 path: octopod-server-image.tar.gz
109+ release:
110+ name: Release
111+ if: github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true'
112+ needs: [octo-macOS, octo-linux, docker-images]
113+ runs-on: "ubuntu-latest"
114+ steps:
115+ - uses: actions/checkout@v2
116+ - name: Common setup
117+ uses: ./.github/actions/common_setup
118+ with:
119+ cachixSigningKey: ${{ secrets.CACHIX_SIGNING_KEY }}
120+ - name: Push Docker Images to DockerHub
121+ uses: ./.github/actions/push_docker_images
122+ with:
123+ tag: ${{ github.event.inputs.version }}
124+ docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
125+ docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
126+
127+ - uses: actions/download-artifact@v2
128+ - name: Zip and move
129+ run: |
130+ chmod +x octo-cli-macos/octo
131+ zip octo-cli-macos octo-cli-macos/octo
132+ chmod +x octo-cli-linux/octo
133+ zip octo-cli-linux octo-cli-linux/octo
134+
135+ mv octo-cli-image/* .
136+ mv octopod-server-image/* .
137+ - uses: "marvinpinto/action-automatic-releases@latest"
138+ with:
139+ repo_token: "${{ secrets.GITHUB_TOKEN }}"
140+ automatic_release_tag: "latest"
141+ prerelease: false
142+ title: "${{ github.event.inputs.version }}"
143+ files: |
144+ *.zip
145+ *.tar.gz
.github/workflows/release.yamldeleted−44
@@ -1,44 +0,0 @@
1−name: Release
2−on:
3− workflow_dispatch:
4− inputs:
5− version:
6− description: The version to release
7− required: true
8−
9−jobs:
10− release:
11− name: "Release"
12− runs-on: "ubuntu-latest"
13− steps:
14− - uses: actions/checkout@v2
15− - name: Common setup
16− uses: ./.github/actions/common_setup
17− with:
18− cachixSigningKey: ${{ secrets.CACHIX_SIGNING_KEY }}
19− - name: Push Docker Images to DockerHub
20− uses: ./.github/actions/push_docker_images
21− with:
22− tag: ${{ github.event.inputs.version }}
23− docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
24− docker_password: ${{ secrets.DOCKERHUB_TOKEN }}
25−
26− - uses: actions/download-artifact@v2
27− - name: Zip and move
28− run: |
29− chmod +x octo-cli-macos/octo
30− zip octo-cli-macos octo-cli-macos/octo
31− chmod +x octo-cli-linux/octo
32− zip octo-cli-linux octo-cli-linux/octo
33−
34− mv octo-cli-image/* .
35− mv octopod-server-image/* .
36− - uses: "marvinpinto/action-automatic-releases@latest"
37− with:
38− repo_token: "${{ secrets.GITHUB_TOKEN }}"
39− automatic_release_tag: "latest"
40− prerelease: false
41− title: "${{ github.event.inputs.version }}"
42− files: |
43− *.zip
44− *.tar.gz