Skip to content

Commit b4ee4c1

Browse files
committed
build single file for sootwrapper
1 parent d05c887 commit b4ee4c1

File tree

1 file changed

+128
-122
lines changed

1 file changed

+128
-122
lines changed

.github/workflows/release.yml

Lines changed: 128 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
# tags:
6+
# - 'v*'
77

88
permissions:
99
contents: write
@@ -58,7 +58,7 @@ jobs:
5858

5959
soot-wrapper:
6060
needs: calculate-checksum
61-
runs-on: ubuntu-latest
61+
runs-on: ubuntu-24.04
6262
strategy:
6363
matrix:
6464
java-version: [ 11, 17, 21 ]
@@ -87,11 +87,17 @@ jobs:
8787
cd java/common/
8888
mvn clean package -X -DskipTests
8989
90+
- uses: awalsh128/cache-apt-pkgs-action@latest
91+
if: needs.calculate-checksum.outputs.hash != needs.calculate-checksum.outputs.prev_hash
92+
with:
93+
packages: xq
94+
version: 1.0
95+
9096
- name: Create archive with generated JARs
9197
if: needs.calculate-checksum.outputs.hash != needs.calculate-checksum.outputs.prev_hash
9298
run: |
9399
cd java/common/target/
94-
zip -r soot-wrapper-${{ matrix.java-version }}.zip SootWrapper-5.1.jar // Use only the jar which includes dependencies
100+
zip soot-wrapper-${{ matrix.java-version }}.zip SootWrapper-$(xq -x 'project/version' ../pom.xml).jar // Use only the jar which includes dependencies
95101
mv soot-wrapper-${{ matrix.java-version }}.zip ../../../soot-wrapper-${{ matrix.java-version }}.zip
96102
97103
- name: Upload the archive
@@ -101,121 +107,121 @@ jobs:
101107
path: soot-wrapper-${{ matrix.java-version }}.zip
102108
overwrite: 'true'
103109

104-
goreleaser:
105-
runs-on: ubuntu-latest
106-
needs: soot-wrapper
107-
steps:
108-
- uses: actions/checkout@v4
109-
with:
110-
fetch-depth: 0
111-
112-
- run: git fetch --force --tags
113-
114-
- uses: actions/setup-go@v5
115-
with:
116-
go-version: '>=1.20'
117-
cache: true
118-
119-
- name: Import GPG signing key
120-
id: import_gpg
121-
uses: crazy-max/ghaction-import-gpg@v6
122-
with:
123-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
124-
passphrase: ${{ secrets.GPG_PASSPHRASE }}
125-
126-
- name: Pull Supported Formats
127-
run: |
128-
cd cmd/debricked
129-
go generate -v -x
130-
131-
- uses: goreleaser/goreleaser-action@v6
132-
with:
133-
distribution: goreleaser
134-
version: latest
135-
args: release --clean
136-
env:
137-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138-
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
139-
140-
- name: Download JAR archives
141-
uses: actions/download-artifact@v4
142-
143-
- name: Add archives with JARs to release
144-
uses: softprops/action-gh-release@v2
145-
if: startsWith(github.ref, 'refs/tags/')
146-
with:
147-
tag_name: ${{ github.ref_name }}
148-
files: |
149-
soot-wrapper-rev-hash.txt/soot-wrapper-rev-hash.txt
150-
soot-wrapper-11.zip/soot-wrapper-11.zip
151-
soot-wrapper-17.zip/soot-wrapper-17.zip
152-
soot-wrapper-21.zip/soot-wrapper-21.zip
153-
154-
major-release:
155-
runs-on: ubuntu-latest
156-
needs: goreleaser
157-
steps:
158-
- uses: actions/checkout@v4
159-
with:
160-
fetch-depth: 0
161-
- name: Update major release tag
162-
id: major-tag
163-
run: |
164-
# returns v1, v2, etc, everything to the left of the leftmost dot.
165-
MAJOR_VERSION="${GITHUB_REF_NAME%%.*}"
166-
MAJOR_TAG="release-${MAJOR_VERSION}"
167-
echo "MAJOR_VERSION=${MAJOR_VERSION}" >> "$GITHUB_OUTPUT"
168-
echo "MAJOR_TAG=${MAJOR_TAG}" >> "$GITHUB_OUTPUT"
169-
git tag -f "${MAJOR_TAG}"
170-
git push -f origin "${MAJOR_TAG}"
171-
- name: Fetch assets from actual release
172-
env:
173-
MAJOR_TAG: ${{ steps.major-tag.outputs.MAJOR_TAG }}
174-
GH_TOKEN: ${{ github.token }}
175-
run: |
176-
gh release download --pattern="cli_*.tar.gz" "${GITHUB_REF_NAME}"
177-
- name: Create or update release
178-
uses: softprops/action-gh-release@v2
179-
with:
180-
body: Latest release for the ${{ steps.major-tag.outputs.MAJOR_VERSION }} branch of the CLI
181-
name: Latest ${{ steps.major-tag.outputs.MAJOR_VERSION }} CLI
182-
tag_name: ${{ steps.major-tag.outputs.MAJOR_TAG }}
183-
fail_on_unmatched_files: true
184-
make_latest: false
185-
files: "cli_*.tar.gz"
186-
187-
188-
aur:
189-
runs-on: ubuntu-latest
190-
needs: goreleaser
191-
container:
192-
image: archlinux/archlinux:base-devel
193-
steps:
194-
- name: Prepare Arch Linux container
195-
run: |
196-
pacman -Syu --noconfirm git go openssh pacman-contrib
197-
useradd -m aur
198-
199-
# Setup SSH access to aur.archlinux.org
200-
- uses: webfactory/[email protected]
201-
with:
202-
ssh-private-key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
203-
204-
# Now actually clone AUR repo, and update to new version
205-
- name: Build package and update AUR
206-
run: |
207-
export NEW_VERSION="${GITHUB_REF_NAME#v}"
208-
sudo -u aur sh -c "mkdir -p /home/aur/.ssh && chmod 700 /home/aur/.ssh && touch /home/aur/.ssh/known_hosts && chmod 600 /home/aur/.ssh/known_hosts"
209-
sudo -u aur sh -c "echo 'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' >> /home/aur/.ssh/known_hosts"
210-
mkdir -p /root/.ssh && chmod 700 /root/.ssh && cp /home/aur/.ssh/known_hosts /root/.ssh/known_hosts && chown root: /root/.ssh/known_hosts
211-
# clone repo
212-
git clone [email protected]:debricked.git debricked
213-
chown -R aur debricked/
214-
cd debricked/
215-
sudo -u aur NEW_VERSION="${NEW_VERSION}" make update_version
216-
sudo -u aur make package
217-
sudo -u aur git diff
218-
sudo -u aur git config user.email [email protected]
219-
sudo -u aur git config user.name "Debricked build bot"
220-
git config --global --add safe.directory "$PWD"
221-
make push
110+
# goreleaser:
111+
# runs-on: ubuntu-latest
112+
# needs: soot-wrapper
113+
# steps:
114+
# - uses: actions/checkout@v4
115+
# with:
116+
# fetch-depth: 0
117+
118+
# - run: git fetch --force --tags
119+
120+
# - uses: actions/setup-go@v5
121+
# with:
122+
# go-version: '>=1.20'
123+
# cache: true
124+
125+
# - name: Import GPG signing key
126+
# id: import_gpg
127+
# uses: crazy-max/ghaction-import-gpg@v6
128+
# with:
129+
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
130+
# passphrase: ${{ secrets.GPG_PASSPHRASE }}
131+
132+
# - name: Pull Supported Formats
133+
# run: |
134+
# cd cmd/debricked
135+
# go generate -v -x
136+
137+
# - uses: goreleaser/goreleaser-action@v6
138+
# with:
139+
# distribution: goreleaser
140+
# version: latest
141+
# args: release --clean
142+
# env:
143+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
145+
146+
# - name: Download JAR archives
147+
# uses: actions/download-artifact@v4
148+
149+
# - name: Add archives with JARs to release
150+
# uses: softprops/action-gh-release@v2
151+
# if: startsWith(github.ref, 'refs/tags/')
152+
# with:
153+
# tag_name: ${{ github.ref_name }}
154+
# files: |
155+
# soot-wrapper-rev-hash.txt/soot-wrapper-rev-hash.txt
156+
# soot-wrapper-11.zip/soot-wrapper-11.zip
157+
# soot-wrapper-17.zip/soot-wrapper-17.zip
158+
# soot-wrapper-21.zip/soot-wrapper-21.zip
159+
160+
# major-release:
161+
# runs-on: ubuntu-latest
162+
# needs: goreleaser
163+
# steps:
164+
# - uses: actions/checkout@v4
165+
# with:
166+
# fetch-depth: 0
167+
# - name: Update major release tag
168+
# id: major-tag
169+
# run: |
170+
# # returns v1, v2, etc, everything to the left of the leftmost dot.
171+
# MAJOR_VERSION="${GITHUB_REF_NAME%%.*}"
172+
# MAJOR_TAG="release-${MAJOR_VERSION}"
173+
# echo "MAJOR_VERSION=${MAJOR_VERSION}" >> "$GITHUB_OUTPUT"
174+
# echo "MAJOR_TAG=${MAJOR_TAG}" >> "$GITHUB_OUTPUT"
175+
# git tag -f "${MAJOR_TAG}"
176+
# git push -f origin "${MAJOR_TAG}"
177+
# - name: Fetch assets from actual release
178+
# env:
179+
# MAJOR_TAG: ${{ steps.major-tag.outputs.MAJOR_TAG }}
180+
# GH_TOKEN: ${{ github.token }}
181+
# run: |
182+
# gh release download --pattern="cli_*.tar.gz" "${GITHUB_REF_NAME}"
183+
# - name: Create or update release
184+
# uses: softprops/action-gh-release@v2
185+
# with:
186+
# body: Latest release for the ${{ steps.major-tag.outputs.MAJOR_VERSION }} branch of the CLI
187+
# name: Latest ${{ steps.major-tag.outputs.MAJOR_VERSION }} CLI
188+
# tag_name: ${{ steps.major-tag.outputs.MAJOR_TAG }}
189+
# fail_on_unmatched_files: true
190+
# make_latest: false
191+
# files: "cli_*.tar.gz"
192+
193+
194+
# aur:
195+
# runs-on: ubuntu-latest
196+
# needs: goreleaser
197+
# container:
198+
# image: archlinux/archlinux:base-devel
199+
# steps:
200+
# - name: Prepare Arch Linux container
201+
# run: |
202+
# pacman -Syu --noconfirm git go openssh pacman-contrib
203+
# useradd -m aur
204+
205+
# # Setup SSH access to aur.archlinux.org
206+
# - uses: webfactory/[email protected]
207+
# with:
208+
# ssh-private-key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
209+
210+
# # Now actually clone AUR repo, and update to new version
211+
# - name: Build package and update AUR
212+
# run: |
213+
# export NEW_VERSION="${GITHUB_REF_NAME#v}"
214+
# sudo -u aur sh -c "mkdir -p /home/aur/.ssh && chmod 700 /home/aur/.ssh && touch /home/aur/.ssh/known_hosts && chmod 600 /home/aur/.ssh/known_hosts"
215+
# sudo -u aur sh -c "echo 'aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN' >> /home/aur/.ssh/known_hosts"
216+
# mkdir -p /root/.ssh && chmod 700 /root/.ssh && cp /home/aur/.ssh/known_hosts /root/.ssh/known_hosts && chown root: /root/.ssh/known_hosts
217+
# # clone repo
218+
# git clone [email protected]:debricked.git debricked
219+
# chown -R aur debricked/
220+
# cd debricked/
221+
# sudo -u aur NEW_VERSION="${NEW_VERSION}" make update_version
222+
# sudo -u aur make package
223+
# sudo -u aur git diff
224+
# sudo -u aur git config user.email [email protected]
225+
# sudo -u aur git config user.name "Debricked build bot"
226+
# git config --global --add safe.directory "$PWD"
227+
# make push

0 commit comments

Comments
 (0)