|
1 |
| -name: Create new release |
2 |
| -concurrency: kongou |
| 1 | +name: Create release |
| 2 | + |
| 3 | +concurrency: |
| 4 | + group: ci-${{ github.ref }} |
| 5 | + cancel-in-progress: false |
3 | 6 |
|
4 | 7 | on:
|
5 |
| - pull_request: |
6 |
| - types: [ closed ] |
7 |
| - branches: [ master ] |
8 |
| - paths: [ 'ungoogled-chromium/**' ] |
| 8 | + workflow_dispatch: |
9 | 9 |
|
10 | 10 | jobs:
|
11 |
| - setup: |
12 |
| - name: Setup build |
13 |
| - runs-on: [ self-hosted ] |
14 |
| - if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]') |
15 |
| - environment: |
16 |
| - name: release |
| 11 | + Fetch: |
| 12 | + runs-on: self-hosted |
| 13 | + outputs: |
| 14 | + version: ${{ steps.version.outputs.version }} |
17 | 15 | steps:
|
18 |
| - - name: Checkout source |
| 16 | + - name: Fetch repository |
19 | 17 | uses: actions/checkout@v2
|
20 | 18 | with:
|
21 | 19 | path: master
|
22 | 20 |
|
23 |
| - - name: Checkout void-packages |
| 21 | + - name: Fetch void-packages |
24 | 22 | uses: actions/checkout@v2
|
25 | 23 | with:
|
26 | 24 | repository: void-linux/void-packages
|
27 | 25 | path: void-packages
|
28 | 26 |
|
29 | 27 | - name: Configure void-packages
|
30 | 28 | run: |
|
31 |
| - cp -rv master/etc/* void-packages/etc |
32 |
| - cp -rv master/ungoogled-chromium void-packages/srcpkgs |
33 |
| - |
34 |
| - - name: Bootstrap x86_64 |
35 |
| - id: x86_64 |
36 |
| - run: | |
37 |
| - cd void-packages |
38 |
| - ./xbps-src binary-bootstrap |
| 29 | + cp -r master/void-packages ./ 2>/dev/null |
39 | 30 |
|
40 |
| - - name: Bootstrap x86_64-musl |
41 |
| - id: x86_64-musl |
42 |
| - if: steps.x86_64.outcome == 'success' |
43 |
| - run: | |
44 |
| - cd void-packages |
45 |
| - ./xbps-src -m masterdir-musl binary-bootstrap x86_64-musl |
46 |
| -
|
47 |
| - - name: Mount local ccache |
48 |
| - if: steps.x86_64.outcome == 'success' && steps.x86_64-musl.outcome == 'success' |
| 31 | + - id: version |
49 | 32 | run: |
|
50 |
| - mount void-packages/hostdir/ccache |
| 33 | + echo "::set-output name=version::$( cat master/version )" |
51 | 34 |
|
52 |
| - build-x86_64: |
53 |
| - name: Build x86_64 |
54 |
| - runs-on: [ self-hosted ] |
55 |
| - timeout-minutes: 1440 |
56 |
| - needs: [ setup ] |
57 |
| - outputs: |
58 |
| - filename: ${{ steps.build.outputs.filename }} |
59 |
| - hash: ${{ steps.build.outputs.hash }} |
| 35 | + Bootstrap: |
| 36 | + needs: [Fetch] |
| 37 | + strategy: |
| 38 | + max-parallel: 1 |
| 39 | + matrix: |
| 40 | + arch: [x86_64, x86_64-musl] |
| 41 | + runs-on: self-hosted |
60 | 42 | steps:
|
61 |
| - - name: Do build |
62 |
| - id: build |
| 43 | + - name: Bootstrap ${{ matrix.arch }} |
63 | 44 | run: |
|
64 | 45 | cd void-packages
|
65 |
| - ./xbps-src pkg ungoogled-chromium |
66 |
| - cd hostdir/binpkgs |
67 |
| - PKG_FILE=$(basename ungoogled-chromium-*.x86_64.xbps) |
68 |
| - PKG_HASH=$(sha256sum $PKG_FILE) |
69 |
| - echo "::set-output name=filename::$PKG_FILE" |
70 |
| - echo "::set-output name=hash::$PKG_HASH" |
| 46 | + ./xbps-src -H /repository -m masterdir-${{ matrix.arch }} binary-bootstrap ${{ matrix.arch }} |
| 47 | + ./xbps-src -H /repository -m masterdir-${{ matrix.arch }} fetch ungoogled-chromium |
71 | 48 |
|
72 |
| - build-x86_64-musl: |
73 |
| - name: Build x86_64-musl |
74 |
| - runs-on: [ self-hosted ] |
75 |
| - timeout-minutes: 1440 |
76 |
| - needs: [ setup, build-x86_64 ] |
77 |
| - outputs: |
78 |
| - filename: ${{ steps.build.outputs.filename }} |
79 |
| - hash: ${{ steps.build.outputs.hash }} |
| 49 | + Build: |
| 50 | + needs: [Fetch, Bootstrap] |
| 51 | + strategy: |
| 52 | + max-parallel: 1 |
| 53 | + matrix: |
| 54 | + arch: [x86_64, x86_64-musl] |
| 55 | + runs-on: self-hosted |
| 56 | + environment: |
| 57 | + name: release |
| 58 | + env: |
| 59 | + XBPS_TARGET_ARCH: ${{ matrix.arch }} |
80 | 60 | steps:
|
81 |
| - - name: Do build |
82 |
| - id: build |
| 61 | + - name: Build ${{ matrix.arch }} |
83 | 62 | run: |
|
84 | 63 | cd void-packages
|
85 |
| - ./xbps-src -m masterdir-musl pkg ungoogled-chromium |
86 |
| - cd hostdir/binpkgs |
87 |
| - PKG_FILE=$(basename ungoogled-chromium-*.x86_64-musl.xbps) |
88 |
| - PKG_HASH=$(sha256sum $PKG_FILE) |
89 |
| - echo "::set-output name=filename::$PKG_FILE" |
90 |
| - echo "::set-output name=hash::$PKG_HASH" |
91 |
| -
|
92 |
| - release: |
93 |
| - name: Create Release |
94 |
| - runs-on: [ self-hosted ] |
95 |
| - needs: [ build-x86_64, build-x86_64-musl ] |
96 |
| - steps: |
97 |
| - - id: version |
| 64 | + ./xbps-src -H /repository -m masterdir-${{ matrix.arch }} -C pkg ungoogled-chromium |
| 65 | + - name: Sign ${{ matrix.arch }} package |
98 | 66 | run: |
|
99 |
| - echo "::set-output name=version::$(echo ${{ needs.build-x86_64.outputs.filename }} | sed 's/.*-\([0-9\.]\+_[0-9]\+\).*/\1/')" |
| 67 | + cd /repository/binpkgs |
| 68 | + xbps-rindex -r $PWD |
| 69 | + XBPS_PASSPHRASE=${{ secrets.SUPERBIA }} xbps-rindex --sign --signedby "Shiraori archive" --privkey /repository/shiraori.pem $PWD |
| 70 | + XBPS_PASSPHRASE=${{ secrets.SUPERBIA }} xbps-rindex --sign-pkg --privkey /repository/shiraori.pem $PWD/*.xbps |
| 71 | + xbps-rindex -c $PWD |
| 72 | + sha256sum ungoogled-chromium-${{ needs.Fetch.outputs.version }}.${{ matrix.arch }}.xbps | tee -a ${{ github.workspace }}/void-packages/sum |
100 | 73 |
|
101 |
| - - id: hash |
| 74 | + Release: |
| 75 | + needs: [Fetch, Build] |
| 76 | + runs-on: self-hosted |
| 77 | + steps: |
| 78 | + - name: Checksum check |
102 | 79 | run: |
|
103 |
| - cd void-packages/hostdir/binpkgs |
104 |
| - echo "${{ needs.build-x86_64.outputs.hash }}" | sha256sum -c |
105 |
| - echo "${{ needs.build-x86_64-musl.outputs.hash }}" | sha256sum -c |
| 80 | + cd /repository/binpkgs |
| 81 | + cat ${{ github.workspace }}/void-packages/sum | sha256sum -c |
106 | 82 |
|
107 |
| - - name: Create new release |
108 |
| - uses: actions/create-release@v1 |
109 |
| - id: create_release |
| 83 | + - name: Publish |
| 84 | + uses: softprops/action-gh-release@v1 |
110 | 85 | with:
|
111 |
| - draft: false |
112 |
| - prerelease: false |
113 |
| - release_name: Release v${{ steps.version.outputs.version }} |
114 |
| - tag_name: v${{ steps.version.outputs.version }} |
115 |
| - body: | |
116 |
| - **Sha256 checksums** |
| 86 | + body_path: ${{ github.workspace }}/void-packages/sum |
| 87 | + files: | |
| 88 | + /repository/binpkgs/ungoogled-chromium-${{ needs.Fetch.outputs.version }}.*.xbps |
| 89 | + /repository/binpkgs/ungoogled-chromium-${{ needs.Fetch.outputs.version }}.*.sig |
| 90 | + /repository/binpkgs/*-repodata |
| 91 | + tag_name: ${{ needs.Fetch.outputs.version }} |
117 | 92 |
|
118 |
| - ``` |
119 |
| - ${{ needs.build-x86_64.outputs.hash }} |
120 |
| - ${{ needs.build-x86_64-musl.outputs.hash }} |
121 |
| - ``` |
122 |
| - env: |
123 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
124 |
| - |
125 |
| - - name: Upload x86_64 asset |
126 |
| - uses: actions/upload-release-asset@v1 |
127 |
| - env: |
128 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 93 | + Cleanup: |
| 94 | + needs: [Release] |
| 95 | + runs-on: self-hosted |
| 96 | + steps: |
| 97 | + - name: Cleanup old release files |
| 98 | + |
129 | 99 | with:
|
130 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
131 |
| - asset_path: void-packages/hostdir/binpkgs/${{ needs.build-x86_64.outputs.filename }} |
132 |
| - asset_name: ${{ needs.build-x86_64.outputs.filename }} |
133 |
| - asset_content_type: application/zstd |
134 |
| - |
135 |
| - - name: Upload x86_64-musl asset |
136 |
| - uses: actions/upload-release-asset@v1 |
| 100 | + keep_latest: 5 |
137 | 101 | env:
|
138 | 102 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
139 |
| - with: |
140 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
141 |
| - asset_path: void-packages/hostdir/binpkgs/${{ needs.build-x86_64-musl.outputs.filename }} |
142 |
| - asset_name: ${{ needs.build-x86_64-musl.outputs.filename }} |
143 |
| - asset_content_type: application/zstd |
144 |
| - |
145 |
| - clean: |
146 |
| - name: Cleanup |
147 |
| - runs-on: [ self-hosted ] |
148 |
| - needs: [ setup, build-x86_64, build-x86_64-musl, release ] |
149 |
| - if: always() && needs.setup.result == 'success' |
150 |
| - steps: |
151 |
| - - name: Unmount local cache |
152 |
| - id: unmount |
153 |
| - run: | |
154 |
| - sync; umount void-packages/hostdir/ccache |
0 commit comments